ScoreRing
The creator's TRNDR score (0–100) as the v3 mock's .ring.sm (36 / 28) in tables, or the 44px ring (size="md") on cards. Read as "TRNDR score: 74"; hover shows "TRNDR score 74 / 100". Null shows "—" ("No score yet").
import { ScoreRing } from '@ergasti/bricks';Examples
Ring
A 0–100 value drawn as a ring with its number inside; label names it for assistive tech; null shows "No score".
Code
import { Ring } from '@ergasti/bricks';
function Rings() {
return (
<div style={{ display: 'flex', gap: 16, alignItems: 'center' }}>
<Ring value={91} label="Completion" />
<Ring value={42} label="Completion" size="sm" />
<Ring value={null} label="Completion" />
</div>
);
}Score ring
The creator score: the same ring with the preset's wording ("TRNDR score" under the TRNDR preset, "Score" under Generic).
Code
import { ScoreRing } from '@ergasti/bricks';
function Scores() {
return (
<div style={{ display: 'flex', gap: 16, alignItems: 'center' }}>
<ScoreRing value={74} />
<ScoreRing value={91} size="md" />
<ScoreRing value={null} />
</div>
);
}A tooltip
title is the native tooltip on hover.
Code
import { Ring } from '@ergasti/bricks';
function Title() {
return <Ring value={68} label="Profile complete" title="Profile 68% complete: add a bio and links" />;
}Props
Prop
Type
Labels
Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key scoreRing, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
label | Score | التقييم |
title | Score {n} / 100 | التقييم: {n} من 100 |
Design guidance
How the BRICKS design system uses ScoreRing. Written in docs/content/components/ScoreRing.md; the props above are read from the code, which wins where the two disagree.
The creator's TRNDR score (0–100) as a small conic ring; use it in the Score column of creator tables and on creator cards.
ScoreRing wraps Ring with the score copy: it is the v3 mock's .ring.sm (36 / 28px) in tables by default, or the 44px ring with size="md" on cards. It is read "Score: 74", hovering shows "Score 74 / 100", and a creator without a score shows "—" and is read "No score yet".
Anatomy
- Ring: conic
--raspfill to the score over--track. - Centre: the number or "—".
- Tooltip (
title): "Score 74 / 100" / "التقييم: 74 من 100" when there is a score.
Variants
size | Look | When |
|---|---|---|
'sm' (default) | 36 / 28px | Table cells |
'md' | 44 / 34px | Find creators cards, profile panels |
States
| State | Trigger | Look |
|---|---|---|
| Score | 0–100 | Filled ring + number |
| No score | null | "—", "No score yet" |
Usage
interface Creator { id: number; name: string; score: number | null }
const columns: DataColumn<Creator>[] = [
{ key: 'name', label: 'Creator', primary: true, render: (c) => <b>{c.name}</b> },
{ key: 'score', label: 'Score', sortKey: 'score', align: 'center', render: (c) => <ScoreRing value={c.score} /> },
];A Find creators card:
<ScoreRing value={creator.score} size="md" />Where it appears
- Brand › Creators › My creators and Join requests tables (Score column).
- Brand › Find creators › creator cards and profile panel.
- PR Portal › Creators table.
- Screens: Creators, Find creators, PR · Creators.
Guidelines
Do
- Keep the column header "Score" and explain the score with a
Termtip in the header. - Pass
nullfor new creators.
Don't
- Don't colour-code scores; the ring is always raspberry.
RTL and Arabic
- Arabic name "التقييم: 74"; digits LTR.
Tokens
--rasp, --track, --card.
Accessibility
- A
Ringwith the score copy: onerole="img"named "Score: 74" (Arabic "التقييم: 74"), or "No score yet" / "لسه مفيش تقييم" fornull. It does not say "of 100"; the hover tooltip ("Score 74 / 100") is for pointer users only. - The number is visible inside the ring, so the score is not colour-only.
- Not focusable. Explain what the score means in the column header (
DataColumn.tip), where it is reachable by keyboard.
Found in the source
- Its tests cover: “is not focusable (a figure, not a control)”.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
Ring: the generic 0–100 ring.ScoreBreakdown/ScoreCard: what makes up the score.
See also: Avatar · AvatarStack · Button · ButtonLink
Source
src/kit/primitives/ScoreRing.tsx (line 9) on GitHub.