TierLadder
The PR mock's Tiers screen (.ladder of .rungs): one card per tier, lowest first, with its level bars, name chip, creator count, what moves a creator up (all-time sales and delivered orders; the first tier is the starting tier) and what creators get. The mock leaves three decisions open (R10 perks, S2 thresholds, S4 adding tiers): each is a prop here (open, thresholdRule, onAddTier / onRemoveTier) rather than a guess. mode="edit" turns the thresholds into fields; Save refuses a tier whose sales or orders are not above the tier before it. v3: basis="score" places creators by TRNDR score instead (one range per tier, "How the score works" through onScoreInfo).
import { TierLadder } from '@ergasti/bricks';Examples
Tier ladder, view and edit
View mode draws the ladder with counts and thresholds; edit mode makes the thresholds fields and reports a map of { sales, orders } on save. open tags a decision still open.
Code
import { TierLadder, type LadderTier } from '@ergasti/bricks';
const tiers: LadderTier[] = [
{ key: 'rising', creators: 812, threshold: null },
{ key: 'established', creators: 301, threshold: { sales: '25000.00', orders: 40 } },
{ key: 'elite', creators: 127, threshold: { sales: '120000.00', orders: 200 }, perks: ['Early access to launches', '+2% commission on every sale'] },
];
function Ladder() {
return (
<div style={{ display: 'grid', gap: 20 }}>
<TierLadder mode="view" tiers={tiers.map((t) => ({ ...t, perks: undefined }))} currentTier="established" open={{ perks: 'R10', thresholds: 'S2', tiers: 'S4' }} onAddTier={() => {}} />
<TierLadder mode="edit" tiers={tiers} onSave={() => {}} onCancel={() => {}} onRemoveTier={() => {}} />
</div>
);
}Either number, and saving
thresholdRule sets how the two numbers combine (here sales_or_orders, drawn as "or"); saving locks the edit while the app saves.
Code
import { TierLadder, type LadderTier } from '@ergasti/bricks';
const tiers: LadderTier[] = [
{ key: 'rising', creators: 812, threshold: null },
{ key: 'established', creators: 301, threshold: { sales: '25000.00', orders: 40 } },
{ key: 'elite', creators: 127, threshold: { sales: '120000.00', orders: 200 }, perks: ['Early access to launches', '+2% commission on every sale'] },
];
function OrRule() {
return <TierLadder mode="edit" tiers={tiers} thresholdRule="sales_or_orders" saving onSave={() => {}} onCancel={() => {}} />;
}By TRNDR score
basis="score" draws the v3 ladder: one score range per tier from its scoreFrom up to one below the next tier's (the top runs to scoreMax, 100), the lowest holding new creators until they have a score, "How the score works" (onScoreInfo or scoreInfoHref) and what creators get; the open perks tag shows its reason as a title tooltip. Read only.
Code
import { TierLadder, type LadderTier } from '@ergasti/bricks';
const tiers: LadderTier[] = [
{ key: 'rising', creators: 812, threshold: null },
{ key: 'established', creators: 301, threshold: { sales: '25000.00', orders: 40 } },
{ key: 'elite', creators: 127, threshold: { sales: '120000.00', orders: 200 }, perks: ['Early access to launches', '+2% commission on every sale'] },
];
function ByScore() {
return (
<TierLadder basis="score" onScoreInfo={() => {}} open={{ perks: 'R10', tiers: 'S4' }} onAddTier={() => {}} tiers={[
{ key: 'rising', creators: 640, scoreFrom: 0, threshold: null },
{ key: 'established', creators: 398, scoreFrom: 40, threshold: null },
{ key: 'influential', creators: 148, scoreFrom: 65, threshold: null },
{ key: 'elite', creators: 54, scoreFrom: 85, threshold: null },
]} />
);
}Score ladder as in the mock
openTagTip="focus" makes the perks tag a tab stop that shows its reason in its own tooltip on hover and keyboard focus (the tag inside "Add a tier" keeps its title tooltip, as a control cannot hold another); scoreText="compact" sets the v3 Tiers page's smaller score text (range 14px, hint and "How the score works" 12px). Both default to 0.4.0's look.
Code
import { TierLadder, type LadderTier } from '@ergasti/bricks';
const tiers: LadderTier[] = [
{ key: 'rising', creators: 812, threshold: null },
{ key: 'established', creators: 301, threshold: { sales: '25000.00', orders: 40 } },
{ key: 'elite', creators: 127, threshold: { sales: '120000.00', orders: 200 }, perks: ['Early access to launches', '+2% commission on every sale'] },
];
function ByScoreMock() {
return (
<TierLadder basis="score" openTagTip="focus" scoreText="compact" onScoreInfo={() => {}} open={{ perks: 'R10', tiers: 'S4' }} onAddTier={() => {}} tiers={[
{ key: 'rising', creators: 640, scoreFrom: 0, threshold: null },
{ key: 'established', creators: 398, scoreFrom: 40, threshold: null },
{ key: 'influential', creators: 148, scoreFrom: 65, threshold: null },
{ key: 'elite', creators: 54, scoreFrom: 85, threshold: null },
]} />
);
}Score info as a link, and ranges that do not line up
scoreInfoHref makes "How the score works" a link to your help page (passed through safeHref) instead of a button. A tier's range runs from its scoreFrom to one below the next tier's; when that would end below its start (two tiers saved with the same start, or a top tier above scoreMax) the tier shows just its start, "40+", never "40–39". Here Established and Influential were both saved at 40 while the PR edits the ladder.
Code
import { TierLadder, type LadderTier } from '@ergasti/bricks';
const tiers: LadderTier[] = [
{ key: 'rising', creators: 812, threshold: null },
{ key: 'established', creators: 301, threshold: { sales: '25000.00', orders: 40 } },
{ key: 'elite', creators: 127, threshold: { sales: '120000.00', orders: 200 }, perks: ['Early access to launches', '+2% commission on every sale'] },
];
function ScoreLinkAndFallback() {
const byScore: LadderTier[] = [
{ key: 'rising', creators: 640, threshold: null, scoreFrom: 0 },
{ key: 'established', creators: 398, threshold: null, scoreFrom: 40 },
{ key: 'influential', creators: 148, threshold: null, scoreFrom: 40 },
{ key: 'elite', creators: 54, threshold: null, scoreFrom: 85 },
];
return <TierLadder tiers={byScore} basis="score" scoreMax={100} scoreInfoHref="https://help.trndr.example/score" />;
}Score ladder in Arabic
"تقييم TRNDR" with each tier's range ("40–64", written left to right) and "التقييم بيتحسب إزاي".
Code
import { TierLadder, type LadderTier } from '@ergasti/bricks';
const tiers: LadderTier[] = [
{ key: 'rising', creators: 812, threshold: null },
{ key: 'established', creators: 301, threshold: { sales: '25000.00', orders: 40 } },
{ key: 'elite', creators: 127, threshold: { sales: '120000.00', orders: 200 }, perks: ['Early access to launches', '+2% commission on every sale'] },
];
function ScoreArabic() {
const byScore: LadderTier[] = [
{ key: 'rising', creators: 640, threshold: null, scoreFrom: 0 },
{ key: 'established', creators: 398, threshold: null, scoreFrom: 40 },
{ key: 'influential', creators: 148, threshold: null, scoreFrom: 65 },
{ key: 'elite', creators: 54, threshold: null, scoreFrom: 85 },
];
return <TierLadder tiers={byScore} basis="score" onScoreInfo={() => {}} />;
}Props
Prop
Type
Labels
Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key prTierLadder, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
ladder | Tier ladder | سلّم المستويات |
creators | {n} creators | {n} صانع محتوى |
movesUp | Moves up at | بيطلع لما يوصل |
gets | What creators get | صنّاع المحتوى بياخدوا إيه |
starting | Starting tier | أول مستوى |
startingHint | Every approved creator starts here | كل صانع محتوى بيتقبل بيبدأ هنا |
current | Current tier | المستوى الحالي |
level | Level {n} of {of} | مستوى {n} من {of} |
sales | All-time sales | المبيعات من الأول |
orders | Delivered orders | الطلبات اللي اتسلمت |
ordersN | {n} delivered orders | {n} طلب اتسلم |
and | and | و |
or | or | أو |
rule.sales_and_orders | Both are needed | لازم الاتنين |
rule.sales_or_orders | Either one is enough | واحد منهم كفاية |
rule.sales | Sales only | المبيعات بس |
rule.orders | Orders only | الطلبات بس |
ruleHint.sales_and_orders | All-time sales and delivered orders | المبيعات من الأول والطلبات اللي اتسلمت |
ruleHint.sales_or_orders | All-time sales or delivered orders | المبيعات من الأول أو الطلبات اللي اتسلمت |
ruleHint.sales | All-time sales | المبيعات من الأول |
ruleHint.orders | Delivered orders | الطلبات اللي اتسلمت |
open | Open · {id} | لسه مفتوح · {id} |
openWhy.perks | What a tier gives creators | المستوى بيدّي صنّاع المحتوى إيه |
openWhy.thresholds | Tier thresholds | حدود المستويات |
openWhy.tiers | Can PR add or remove tiers? | الـ PR يقدر يزوّد أو يشيل مستويات؟ |
none | Nothing yet | لسه مفيش |
add | Add a tier | زوّد مستوى |
remove | Remove {t} | شيل {t} |
save | Save thresholds | احفظ الحدود |
cancel | Cancel | إلغاء |
saving | Saving… | بنحفظ… |
salesErr | Enter an amount (0 or more). | اكتب مبلغ (صفر أو أكتر). |
ordersErr | Enter a whole number (0 or more). | اكتب رقم صحيح (صفر أو أكتر). |
salesAsc | Must be more than {prev}’s. | لازم يكون أكتر من {prev}. |
ordersAsc | Must be more than {prev}’s. | لازم يكون أكتر من {prev}. |
fix | Fix the highlighted thresholds first. | صلّح الحدود المتعلّم عليها الأول. |
score | TRNDR score | تقييم TRNDR |
range | {from}–{to} | {from}–{to} |
unscored | New creators show here until they have a score | صنّاع المحتوى الجداد بيظهروا هنا لحد ما يبقى ليهم تقييم |
how | How the score works | التقييم بيتحسب إزاي |
scoreFromOnly | {from}+ | {from}+ |
Design guidance
How the BRICKS design system uses TierLadder. Written in docs/content/components/TierLadder.md; the props above are read from the code, which wins where the two disagree.
The PR Tiers screen's ladder: one card per tier, lowest first, with its level bars, name, creator count, what moves a creator up (sales and orders, or a TRNDR score range) and what creators get; use it on the Tiers page to view or edit tier rules.
TierLadder is the PR mock's .ladder of .rungs. In v2 creators moved up by all-time sales and delivered orders (basis="sales", editable with mode="edit"; Save refuses thresholds that do not rise tier by tier). In v3 creators are placed by TRNDR score (basis="score"): one range per tier ("40–64") from each tier's scoreFrom, the lowest tier holding new creators until they have a score, read-only, with "How the score works". The mock leaves three decisions open (R10 perks, S2 thresholds, S4 adding tiers); each is a prop (open, thresholdRule, onAddTier / onRemoveTier) rather than a guess, drawn as "Open · R10" tags.
Anatomy
- Ladder:
<ol aria-label="Tier ladder">; sales basis: cards in a row; score basis: one row oftiers.lengthcolumns (two under 1240px), "Add a tier" below. - Rung (
<li>, labelled by its chip;aria-current="step"forcurrentTier):- Level bars:
role="img""Level 2 of 4", filled up to this tier. - Head:
TierChip, a "Current tier" mark, "301 creators". - Moves up (sales): "All-time sales EGP 25,000 and 40 delivered orders" (the joiner from
thresholdRule); first tier: "Starting tier · Every approved creator starts here". In edit mode: sales and orders inputs with errors. - Score (score): "TRNDR score 40–64" (or "40+"), hint, "How the score works" link or button; lowest: "New creators show here until they have a score".
- What creators get: perks list, "Nothing yet", or the "Open · R10" tag.
- Remove (with
onRemoveTier, all but the first).
- Level bars:
- Add a tier (with
onAddTier): a dashed tile; withopen.tiersit carries the tag and is disabled. - Edit footer (
mode="edit"): error summary "Fix the highlighted thresholds first.", Cancel, Save thresholds ("Saving…").
Variants
| Prop | Value | Effect | When to use |
|---|---|---|---|
basis | sales (default) | Sales + orders thresholds | v2 rules, editable |
score | Score ranges, read-only | v3 Tiers page | |
mode | view (default) / edit | Thresholds as text / fields | Admin editing |
thresholdRule | sales_and_orders (default), sales_or_orders, sales, orders | "and" / "or" / one number | Decision S2 |
open | { perks?, thresholds?, tiers? } | "Open · X" tags instead of values; thresholds read-only; Add tile disabled | Open decisions R10 / S2 / S4 |
openTagTip | title (default) / focus | Tag tooltip by title or focusable tooltip | focus matches the v3 mock |
scoreText | default / compact | Range 15px / 14px, hint 12.5px / 12px | compact matches the v3 mock |
scoreMax | default 100 | Top of the top tier's range | Other scales |
The "Open · R10" / "Open · S4" tags are design-review placeholders for undecided product rules (see DecisionTag): remove them (leave open empty) before release. In the preview, the first two examples are the v3 Tiers page with all four tiers (Rising, Established, Influential, Elite); "Open decisions" and "Edit" use the stories' three-tier sales sample (Rising, Established, Elite).
States
| State | Trigger |
|---|---|
| Current tier | currentTier |
| Invalid threshold | edit Save with a non-number or a value not above the tier before: "Must be more than Rising's." |
| Saving | saving: fields and Save locked |
| Range fallback | a range ending below its start shows "40+" |
Types
LadderTier (tiers), lowest first: { key, name?, creators, threshold: { sales, orders } | null, perks?, scoreFrom? }.
Usage
import { TierLadder } from '@ergasti/bricks';
export function ByScoreMock() {
return (
<TierLadder basis="score" openTagTip="focus" scoreText="compact" onScoreInfo={() => {}} open={{ perks: 'R10', tiers: 'S4' }} onAddTier={() => {}} tiers={[
{ key: 'rising', creators: 640, scoreFrom: 0, threshold: null },
{ key: 'established', creators: 398, scoreFrom: 40, threshold: null },
{ key: 'influential', creators: 148, scoreFrom: 65, threshold: null },
{ key: 'elite', creators: 54, scoreFrom: 85, threshold: null },
]} />
);
}// Sales thresholds, view and edit
import { TierLadder, type LadderTier } from '@ergasti/bricks';
const tiers: LadderTier[] = [
{ key: 'rising', creators: 812, threshold: null },
{ key: 'established', creators: 301, threshold: { sales: '25000.00', orders: 40 } },
{ key: 'elite', creators: 127, threshold: { sales: '120000.00', orders: 200 }, perks: ['Early access to launches', '+2% commission on every sale'] },
];
export function Ladder() {
return (
<div style={{ display: 'grid', gap: 20 }}>
<TierLadder mode="view" tiers={tiers.map((t) => ({ ...t, perks: undefined }))} currentTier="established" open={{ perks: 'R10', thresholds: 'S2', tiers: 'S4' }} onAddTier={() => {}} />
<TierLadder mode="edit" tiers={tiers} onSave={() => {}} onCancel={() => {}} onRemoveTier={() => {}} />
</div>
);
}// Tiers page: ladder, explainer and the moves lists
<TierLadder basis="score" tiers={ladder} onScoreInfo={() => setExplainer(true)} open={{ perks: 'R10', tiers: 'S4' }} onAddTier={() => {}} />
<ScoreExplainer open={explainer} onClose={() => setExplainer(false)} />
<Card title="Recent automatic moves"><TierMoveList label="Recent automatic moves" moves={auto} onChange={setChanging} /></Card>Where it appears
- PR Portal › Tiers › the ladder (score-based in v3, with "Open · R10" perks and "Add a tier · S4").
- Dashboard screen: PrTiers.
Guidelines
Do
- Pass open decision ids instead of inventing perks or thresholds.
- Use
basis="score"for the v3 product; keepsalesonly where the backend still ranks by sales. - Send money thresholds as 2-dp strings.
Don't
- Don't let PR edit thresholds while
open.thresholdsis set (the ladder prevents it). - Don't reorder tiers; pass them lowest first.
RTL and Arabic
The ladder runs right to left; score ranges stay left to right ("40–64"). Arabic: "سلّم المستويات", "تقييم TRNDR", "التقييم بيتحسب إزاي", "لسه مفتوح · R10".
Tokens
--line, --card, --r-lg, --radius-md, --track, --rasp, --ink, --ink-3, --bad, --color-control-border-hover, --color-text-inverted, --focus-ring-field, --kit-pr-ladder-n (set from the tier count).
Accessibility
An ordered list labelled "Tier ladder"; each rung labelled by its tier name, the current one aria-current="step"; level bars are an image with "Level 2 of 4"; edit fields are labelled with errors tied to them; open tags read their reason (or show a focusable tooltip with openTagTip="focus").
Found in the source
- Roles in the markup:
img,alert. - ARIA attributes set:
aria-label,aria-current,aria-labelledby,aria-invalid,aria-describedby. - Its tests cover: “edit: fields for every tier but the first; Save refuses thresholds that do not rise, by keyboard”.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
TierMoveList,TierChangeDialog: the rest of the Tiers page.ScoreExplainer/ScoreBreakdown: the score.DecisionTag: the same "Open · X" pill.TierChip(kit): a tier on its own.
See also: Button · Money · MoneyNote · useBricks · useLanguage · PrIcon
Source
src/pr/tiers/TierLadder.tsx (line 171) on GitHub.