Ring
The mock's .ring (44 / 34): a conic score 0–100; null shows "—". v3: size="sm" is the table's 36 / 28.
import { Ring } 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 ring, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
noScore | No score yet | لسه مفيش تقييم |
Design guidance
How the BRICKS design system uses Ring. Written in docs/content/components/Ring.md; the props above are read from the code, which wins where the two disagree.
A small conic ring showing a 0–100 value with the number in the middle; use it for scores, through ScoreRing for the TRNDR score.
Ring is the mock's .ring: a 44px circle with a raspberry conic fill to the value over the grey track and a 34px card-coloured centre holding the number (12px 800). size="sm" is the v3 table size, 36 / 28px with 11px text. Values are clamped to 0–100 and rounded; null shows "—" and is read "No score yet". It is one image to assistive tech, named "{label}: {value}".
Anatomy
- Ring (
span.kit-ring,role="img",--pcustom property = value):conic-gradient(--rasp p%, --track 0). - Centre (
span,aria-hidden,dir="ltr"): the number or "—".
Variants
size | Outer / inner | Text | When |
|---|---|---|---|
'md' (default) | 44 / 34px | 12px | Cards, panels |
'sm' | 36 / 28px | 11px | Table cells |
States
| State | Trigger | Look |
|---|---|---|
| Value | 0–100 | Ring filled to the value |
| Out of range | <0 or >100 | Clamped |
| No value | null | Empty ring, "—", name "No score yet" / "لسه مفيش تقييم" |
Usage
<Ring value={82} label="Open rate" />
<Ring value={null} label="Engagement" size="sm" />For the creator score, use the wrapper:
<ScoreRing value={74} />Where it appears
- Through
ScoreRing: Brand › Creators tables, Find creators cards, creator profile; PR Portal creators. - Kit gallery.
Guidelines
Do
- Use it only for 0–100 scales.
- Use
ScoreRingfor the TRNDR score so wording stays consistent.
Don't
RTL and Arabic
- The conic fill starts at the top and runs clockwise in both directions; digits LTR.
Tokens
--rasp, --track, --card.
Accessibility
- One
role="img"named "{label}: {value}" ("Open rate: 82"); withnullit is named "No score yet" / "لسه مفيش تقييم". The number inside isaria-hidden, so it is not read twice. titleadds a hover tooltip only; screen readers use the name.- The value is never colour-only: the number is drawn in the centre. The raspberry fill on
--trackis decoration. - Not focusable and not interactive.
Found in the source
- Roles in the markup:
img. - ARIA attributes set:
aria-label,aria-hidden.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
ScoreRing: Ring with the score copy.ScoreBreakdown: the score's parts.
See also: Avatar · AvatarStack · Button · ButtonLink
Source
src/kit/primitives/Ring.tsx (line 9) on GitHub.