Skip to Content
BBRICKSv0.7.4
PR PortalTiers

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 },
    ]} />
  );
}

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 "التقييم بيتحسب إزاي".

Pinned to Arabic
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.

prTierLadder
KeyEnglishArabic
ladderTier ladderسلّم المستويات
creators{n} creators{n} صانع محتوى
movesUpMoves up atبيطلع لما يوصل
getsWhat creators getصنّاع المحتوى بياخدوا إيه
startingStarting tierأول مستوى
startingHintEvery approved creator starts hereكل صانع محتوى بيتقبل بيبدأ هنا
currentCurrent tierالمستوى الحالي
levelLevel {n} of {of}مستوى {n} من {of}
salesAll-time salesالمبيعات من الأول
ordersDelivered ordersالطلبات اللي اتسلمت
ordersN{n} delivered orders{n} طلب اتسلم
andandو
ororأو
rule.sales_and_ordersBoth are neededلازم الاتنين
rule.sales_or_ordersEither one is enoughواحد منهم كفاية
rule.salesSales onlyالمبيعات بس
rule.ordersOrders onlyالطلبات بس
ruleHint.sales_and_ordersAll-time sales and delivered ordersالمبيعات من الأول والطلبات اللي اتسلمت
ruleHint.sales_or_ordersAll-time sales or delivered ordersالمبيعات من الأول أو الطلبات اللي اتسلمت
ruleHint.salesAll-time salesالمبيعات من الأول
ruleHint.ordersDelivered ordersالطلبات اللي اتسلمت
openOpen · {id}لسه مفتوح · {id}
openWhy.perksWhat a tier gives creatorsالمستوى بيدّي صنّاع المحتوى إيه
openWhy.thresholdsTier thresholdsحدود المستويات
openWhy.tiersCan PR add or remove tiers?الـ PR يقدر يزوّد أو يشيل مستويات؟
noneNothing yetلسه مفيش
addAdd a tierزوّد مستوى
removeRemove {t}شيل {t}
saveSave thresholdsاحفظ الحدود
cancelCancelإلغاء
savingSaving…بنحفظ…
salesErrEnter an amount (0 or more).اكتب مبلغ (صفر أو أكتر).
ordersErrEnter a whole number (0 or more).اكتب رقم صحيح (صفر أو أكتر).
salesAscMust be more than {prev}’s.لازم يكون أكتر من {prev}.
ordersAscMust be more than {prev}’s.لازم يكون أكتر من {prev}.
fixFix the highlighted thresholds first.صلّح الحدود المتعلّم عليها الأول.
scoreTRNDR scoreتقييم TRNDR
range{from}–{to}{from}–{to}
unscoredNew creators show here until they have a scoreصنّاع المحتوى الجداد بيظهروا هنا لحد ما يبقى ليهم تقييم
howHow 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

  1. Ladder: <ol aria-label="Tier ladder">; sales basis: cards in a row; score basis: one row of tiers.length columns (two under 1240px), "Add a tier" below.
  2. Rung (<li>, labelled by its chip; aria-current="step" for currentTier):
    • 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).
  3. Add a tier (with onAddTier): a dashed tile; with open.tiers it carries the tag and is disabled.
  4. Edit footer (mode="edit"): error summary "Fix the highlighted thresholds first.", Cancel, Save thresholds ("Saving…").

Variants

PropValueEffectWhen to use
basissales (default)Sales + orders thresholdsv2 rules, editable
scoreScore ranges, read-onlyv3 Tiers page
modeview (default) / editThresholds as text / fieldsAdmin editing
thresholdRulesales_and_orders (default), sales_or_orders, sales, orders"and" / "or" / one numberDecision S2
open{ perks?, thresholds?, tiers? }"Open · X" tags instead of values; thresholds read-only; Add tile disabledOpen decisions R10 / S2 / S4
openTagTiptitle (default) / focusTag tooltip by title or focusable tooltipfocus matches the v3 mock
scoreTextdefault / compactRange 15px / 14px, hint 12.5px / 12pxcompact matches the v3 mock
scoreMaxdefault 100Top of the top tier's rangeOther 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

StateTrigger
Current tiercurrentTier
Invalid thresholdedit Save with a non-number or a value not above the tier before: "Must be more than Rising's."
Savingsaving: fields and Save locked
Range fallbacka 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; keep sales only where the backend still ranks by sales.
  • Send money thresholds as 2-dp strings.

Don't

  • Don't let PR edit thresholds while open.thresholds is 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.

See also: Button · Money · MoneyNote · useBricks · useLanguage · PrIcon

Source

src/pr/tiers/TierLadder.tsx (line 171) on GitHub.

On this page