Skip to Content
BBRICKSv0.7.4
KitPrimitives

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.

scoreRing
KeyEnglishArabic
labelScoreالتقييم
titleScore {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

  1. Ring: conic --rasp fill to the score over --track.
  2. Centre: the number or "—".
  3. Tooltip (title): "Score 74 / 100" / "التقييم: 74 من 100" when there is a score.

Variants

sizeLookWhen
'sm' (default)36 / 28pxTable cells
'md'44 / 34pxFind creators cards, profile panels

States

StateTriggerLook
Score0–100Filled ring + number
No scorenull"—", "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 Term tip in the header.
  • Pass null for 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 Ring with the score copy: one role="img" named "Score: 74" (Arabic "التقييم: 74"), or "No score yet" / "لسه مفيش تقييم" for null. 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.

See also: Avatar · AvatarStack · Button · ButtonLink

Source

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

On this page