TierBadge
The v3 mock's .tier (as TierChip): a soft pair with a dot (Elite: a star), Rising lime, Established sky, Elite gold, Influential teal. No tier yet = Rising (the house default); a tier name the console does not know renders nothing.
import { TierBadge } from '@ergasti/bricks';Examples
Tiers
The chip colours come from the --tier-<key>-bg and --tier-<key>-ink tokens; the words from the provider's tiers. Under the TRNDR preset: Rising, Established, Influential, Elite.
Code
import { TierChip, TRNDR_TIERS } from '@ergasti/bricks';
function Chips() {
return (
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
{Object.keys(TRNDR_TIERS).map((tier) => <TierChip key={tier} tier={tier} />)}
</div>
);
}TierBadge
The same chip under its older name; an unknown or empty tier draws the preset's defaultTier or nothing.
Code
import { TierBadge } from '@ergasti/bricks';
function Badges() {
return (
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 8, alignItems: 'center' }}>
<TierBadge tier="elite" />
<TierBadge tier="rising" />
<TierBadge tier={null} />
<small>(null draws nothing)</small>
</div>
);
}Props
Prop
Type
Design guidance
How the BRICKS design system uses TierBadge. Written in docs/content/components/TierBadge.md; the props above are read from the code, which wins where the two disagree.
A creator's tier as a soft pill with a dot, the same look as TierChip under its earlier name; prefer TierChip in new code.
TierBadge is kept for code written against 0.x. It renders the v3 mock's .tier exactly like TierChip (the CSS rules are shared: .kit-tierc, .kit-tier): a soft colour pair per tier, a dot (a star for Elite), the label from the provider's tiers table. No tier yet shows the provider's defaultTier (Rising in TRNDR); an unknown key renders nothing.
Anatomy
- Pill (
span.kit-tier.kit-tier--{key}). - Dot / star (
::before). - Label.
Variants
| Tier | Label (en / ar) | Tokens |
|---|---|---|
rising | Rising / صاعد | --tier-rising-* |
established | Established / متمكن | --tier-established-* |
influential | Influential / مؤثر | --tier-influential-* |
elite | Elite / نخبة | --tier-elite-*, star |
States
| State | Trigger | Look |
|---|---|---|
| Known | key in tiers | Chip |
| None | null / undefined | Default tier |
| Unknown | missing key | Nothing |
Types
Also exported: the Tier type (the TRNDR preset's tier keys).
Usage
<TierBadge tier="elite" />Migrating:
// before
<TierBadge tier={creator.tier} />
// after
<TierChip tier={creator.tier} />Where it appears
- Not used by the v3 screens (they use
TierChip); kit gallery only.
Guidelines
Do
- Switch to
TierChipwhen you touch the code.
Don't
- Don't mix TierBadge and TierChip on one screen; they look the same but have different class names for custom CSS.
RTL and Arabic
- As TierChip: Arabic labels at 12px, dot at the inline start.
Tokens
--tier-rising-bg/-ink, --tier-established-bg/-ink, --tier-influential-bg/-ink, --tier-elite-bg/-ink.
Accessibility
- Same as
TierChip: a non-interactivespanread as its label; the dot or star is decoration (::before). - Contrast pairs as TierChip (Rising 5.58:1, Established 6.83:1, Influential 5.68:1, Elite 5.24:1).
- An unknown tier renders nothing, and nothing is read.
Found in the source
- No roles, ARIA attributes or key handling are set in this component's own source; it renders native elements and the components it composes.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
TierChip: the current name.
See also: Avatar · AvatarStack · Button · ButtonLink
Source
src/kit/primitives/TierBadge.tsx (line 14) on GitHub.