Skip to Content
BBRICKSv0.7.4
KitPrimitives

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.

ring
KeyEnglishArabic
noScoreNo 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

  1. Ring (span.kit-ring, role="img", --p custom property = value): conic-gradient(--rasp p%, --track 0).
  2. Centre (span, aria-hidden, dir="ltr"): the number or "—".

Variants

sizeOuter / innerTextWhen
'md' (default)44 / 34px12pxCards, panels
'sm'36 / 28px11pxTable cells

States

StateTriggerLook
Value0–100Ring filled to the value
Out of range<0 or >100Clamped
No valuenullEmpty 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 ScoreRing for the TRNDR score so wording stays consistent.

Don't

  • Don't use it for money or counts; use Pips or ShareBar for progress.

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"); with null it is named "No score yet" / "لسه مفيش تقييم". The number inside is aria-hidden, so it is not read twice.
  • title adds 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 --track is 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.

See also: Avatar · AvatarStack · Button · ButtonLink

Source

src/kit/primitives/Ring.tsx (line 9) on GitHub.

On this page