ScoreBreakdown
The PR creator drawer's TRNDR score card (v3 mock pulseRows): "TRNDR score" and "91 / 100", then each part with what was read ("8.0% engagement"), its points ("25 / 25") and a raspberry bar, the formula and a "How the score works" link. With no score: a "Still measuring" pill (or "Customer" for a customer affiliate) and why. The bars are decoration: each row's points are written out. A part's "what it measures" is its tooltip, as the mock's.
import { ScoreBreakdown } from '@ergasti/bricks';Examples
TRNDR score
The score with its nine parts (what was read, the points, a bar) and the formula; "How the score works" opens the ScoreExplainer modal. Pass parts as the backend splits the score.
Code
import { useState } from 'react';
import { ScoreBreakdown, ScoreExplainer, type ScorePart } from '@ergasti/bricks';
const parts: ScorePart[] = [
{ key: 'followers', points: 19, reading: '460K followers' }, { key: 'engagement', points: 25, reading: '8.0% engagement' },
{ key: 'approved_tasks', points: 8, reading: '8 approved' }, { key: 'packages_done', points: 9, reading: '5 finished' },
{ key: 'verified_accounts', points: 5, reading: '2 of 2 verified' }, { key: 'posting', points: 5, reading: '2.0 posts a week' },
{ key: 'growth', points: 5, reading: '+20% a month' }, { key: 'on_time', points: 7, reading: '7 of 10 on time', provisional: true },
{ key: 'quality', points: 8, reading: '4.0 / 5 average' },
];
function Score() {
const [open, setOpen] = useState(false);
return (
<div style={{ maxWidth: 380 }}>
<ScoreBreakdown score={91} parts={parts} onExplain={() => setOpen(true)} />
<ScoreExplainer open={open} onClose={() => setOpen(false)} />
</div>
);
}No score
Still measuring (no verified followers and engagement yet), or a customer affiliate, who has no score or tier.
Code
import { ScoreBreakdown } from '@ergasti/bricks';
function NoScore() {
return (
<div style={{ display: 'grid', gap: 12, maxWidth: 380 }}>
<ScoreBreakdown score={null} onExplain={() => {}} />
<ScoreBreakdown score={null} track="customer" onExplain={() => {}} />
</div>
);
}As kit pieces
variant="card" draws the same content as a Card variant="inset" with the score as its badge and DetailsBars variant="stacked" rows, for an app that styles those kit pieces.
Code
import { ScoreBreakdown, type ScorePart } from '@ergasti/bricks';
const parts: ScorePart[] = [
{ key: 'followers', points: 19, reading: '460K followers' }, { key: 'engagement', points: 25, reading: '8.0% engagement' },
{ key: 'approved_tasks', points: 8, reading: '8 approved' }, { key: 'packages_done', points: 9, reading: '5 finished' },
{ key: 'verified_accounts', points: 5, reading: '2 of 2 verified' }, { key: 'posting', points: 5, reading: '2.0 posts a week' },
{ key: 'growth', points: 5, reading: '+20% a month' }, { key: 'on_time', points: 7, reading: '7 of 10 on time', provisional: true },
{ key: 'quality', points: 8, reading: '4.0 / 5 average' },
];
function KitCard() {
return (
<div style={{ display: 'grid', gap: 12, maxWidth: 380 }}>
<ScoreBreakdown variant="card" score={91} parts={parts} onExplain={() => {}} />
<ScoreBreakdown variant="card" score={null} onExplain={() => {}} />
</div>
);
}Props
Prop
Type
Labels
Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key prScore, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
title | TRNDR score | تقييم TRNDR |
outOf | / 100 | / 100 |
of | {pts} / {max} | {pts} / {max} |
pointsOf | {pts} of {max} points | {pts} من {max} نقطة |
customer | Customer | عميل |
measuring | Still measuring | لسه بنقيس |
notMeasured | Not measured yet | لسه متقاسش |
provisional | provisional | مبدئي |
customerText | Customer affiliates have no TRNDR score or tier, and get no gifts or challenges. | العملاء الأفلييت ملهمش تقييم TRNDR ولا مستوى، ومبياخدوش هدايا ولا يدخلوا تحديات. |
measuringText | No score until we can read followers and engagement from a verified account. | مفيش تقييم لحد ما نقدر نقرا المتابعين والتفاعل من حساب موثّق. |
formula | Score = points earned ÷ points we can measure × 100. A part we can’t measure yet is left out, not counted as 0. | التقييم = النقط اللي جابها ÷ النقط اللي نقدر نقيسها × 100. الجزء اللي لسه منقدرش نقيسه بيتشال من الحساب، مش بيتحسب صفر. |
how | How the score works | التقييم بيتحسب إزاي |
parts.followers | Followers,All verified accounts added up, on a log scale. About 890K is full marks. | المتابعين,كل الحسابات الموثّقة مع بعض، على مقياس لوغاريتمي. حوالي 890 ألف هي الدرجة الكاملة. |
parts.engagement | Engagement,Best engagement rate across their accounts. 8% is full marks. | التفاعل,أعلى نسبة تفاعل على حساباته. 8% هي الدرجة الكاملة. |
parts.approved_tasks | Approved tasks,Videos and posts TRNDR approved. 10 is full marks. | مهام اتقبلت,فيديوهات وبوستات TRNDR وافقت عليها. 10 هي الدرجة الكاملة. |
parts.packages_done | Packages done,Gift packages finished. 5 is full marks. | باكدجات خلصت,باكدجات هدايا خلّصها. 5 هي الدرجة الكاملة. |
parts.verified_accounts | Verified accounts,Share of connected accounts that are verified. | حسابات موثّقة,نسبة الحسابات المربوطة اللي موثّقة. |
parts.posting | Posting,Posts per week over the last 60 days. 2 a week is full marks. | النشر,بوستات في الأسبوع آخر 60 يوم. 2 في الأسبوع هي الدرجة الكاملة. |
parts.growth | Growth,Follower growth per month: 20%+ full, then 10%, 5%, 2%, 0%. | النمو,نمو المتابعين في الشهر: 20%+ كاملة، وبعدها 10% و5% و2% و0%. |
parts.on_time | On time,Last 10 deliveries on time. New creators start at 80%. | في الميعاد,آخر 10 تسليمات في ميعادها. صنّاع المحتوى الجداد بيبدأوا من 80%. |
parts.quality | Quality,Average TRNDR rating of the last 10 videos. New creators start at 70%. | الجودة,متوسط تقييم TRNDR لآخر 10 فيديوهات. صنّاع المحتوى الجداد بيبدأوا من 70%. |
explainTitle | How the TRNDR score works | تقييم TRNDR بيتحسب إزاي |
explainSub | A number from 0 to 100, the same on every brand. TRNDR recalculates it automatically as new data comes in. | رقم من 0 لـ 100، هو هو على كل البراندات. TRNDR بيحسبه تاني لوحده كل ما بيانات جديدة توصل. |
part | Part | الجزء |
points | Points | النقط |
measures | What it measures | بيقيس إيه |
total | Total | المجموع |
notes | ,No score yet ("Still measuring"), until we can read both followers and engagement from a verified account.,Parts we can’t measure yet are left out of the total, not counted as zero.,,,On time and Quality count as ,provisional, until the creator has 10 deliveries or ratings.,Follower and engagement readings older than 120 days stop counting.,,,Sales and commission are ,not, part of the score. | ,مفيش تقييم لسه ("لسه بنقيس"), لحد ما نقدر نقرا المتابعين والتفاعل الاتنين من حساب موثّق.,الأجزاء اللي لسه منقدرش نقيسها بتتشال من المجموع، مش بتتحسب صفر.,,,الالتزام بالميعاد والجودة بيتحسبوا ,مبدئي, لحد ما صانع المحتوى يكمّل 10 تسليمات أو تقييمات.,قراءات المتابعين والتفاعل اللي عدّى عليها أكتر من 120 يوم مبتتحسبش.,,,المبيعات والعمولة ,مش, جزء من التقييم. |
Design guidance
How the BRICKS design system uses ScoreBreakdown. Written in docs/content/components/ScoreBreakdown.md; the props above are read from the code, which wins where the two disagree.
The TRNDR score card: the creator's score out of 100 and its nine parts with readings, points and bars, or why there is no score; use it in the PR creator drawer and anywhere PR needs to explain a score.
ScoreBreakdown is the v3 mock's pulseRows (Creator Pulse v2, the backend's PulseScoreV2). Each part shows what was read ("8.0% engagement"), the points ("25 / 25") and a raspberry bar; a part that cannot be measured says "Not measured yet" and is left out of the total. Without a score it shows a "Still measuring" pill (or "Customer" for a customer affiliate) and the reason. ScoreExplainer is the "How the TRNDR score works" modal that the card's link opens, and TRNDR_SCORE_PARTS lists the parts and their maximum points.
Anatomy
ScoreBreakdown
- Card:
<section aria-labelledby>, 16px padding,--lineborder,--r-lgradius, white. - Head: "TRNDR score" heading (
h3by default, 15px / 700) and the value "91 / 100" (24px / 800 display, the "/ 100" muted), or a mutePill. - Parts list: one
<li>per part, ruled: bold name, muted " · reading", " (provisional)"; at the end "25 / 25" or "Not measured yet"; a 6px track with a raspberry fill. The part's "what it measures" is itstitletooltip. - Foot: the formula ("Score = points earned ÷ points we can measure × 100…") and the "How the score works" link.
- No score: the reason ("No score until we can read followers and engagement from a verified account.") and the link.
ScoreExplainer: a kit Modal with a table (Part, Points, What it measures; a Total row) and five rule notes.
Variants
| Prop | Value | Look | When to use |
|---|---|---|---|
track | creator (default) | Score and parts, or "Still measuring" | Creators |
customer | "Customer" pill and the customer text | Customer affiliates (no score, tier, gifts or challenges) | |
headingLevel | 2, 3 (default), 4 | Heading element | Match the page outline (3 in a drawer under the name) |
parts | omitted | Score only, no list | Where the split is not loaded |
States
| State | Trigger |
|---|---|
| Scored | score is a number |
| Still measuring | score={null}, track="creator" |
| Customer | track="customer" (score ignored) |
| Part not measured | part points: null: "Not measured yet", empty bar |
| Provisional part | part provisional: true: "(provisional)" |
| With link | onExplain given |
Types
ScorePart: key (a ScorePartKey or your own), points: number | null, max? (default from TRNDR_SCORE_PARTS), name?, reading?: ReactNode, provisional?: boolean.
ScoreExplainer (ScoreExplainerProps): open (required), onClose (required), parts? (default TRNDR_SCORE_PARTS; { key, max, name?, measures? }), language?, labels?, inertRef?.
TRNDR_SCORE_PARTS: followers 20, engagement 25, approved_tasks 10, packages_done 10, verified_accounts 5, posting 5, growth 5, on_time 10, quality 10 (100 total).
Usage
import { ScoreBreakdown, ScoreExplainer } from '@ergasti/bricks';
<ScoreBreakdown
score={91}
parts={[
{ key: 'followers', points: 19, reading: '460K followers' },
{ key: 'engagement', points: 25, reading: '8.0% engagement' },
{ key: 'on_time', points: 7, reading: '7 of 10 on time', provisional: true },
{ key: 'quality', points: null },
]}
onExplain={() => setExplainer(true)}
/>
<ScoreExplainer open={explainer} onClose={() => setExplainer(false)} />// A creator still being measured, and a customer affiliate
<ScoreBreakdown score={null} onExplain={() => setExplainer(true)} />
<ScoreBreakdown score={null} track="customer" />// Inside the creator drawer (PrCreatorDrawer draws it for you from creator.score / scoreParts)
<PrCreatorDrawer open creator={nour} onClose={close} onExplainScore={() => setExplainer(true)} />TRNDR score. The score with its nine parts (what was read, the points, a bar) and the formula; "How the score works" opens the ScoreExplainer modal. Pass parts as the backend splits the score. (docs example Score)
import { useState } from 'react';
import { ScoreBreakdown, ScoreExplainer, type ScorePart } from '@ergasti/bricks';
const parts: ScorePart[] = [
{ key: 'followers', points: 19, reading: '460K followers' }, { key: 'engagement', points: 25, reading: '8.0% engagement' },
{ key: 'approved_tasks', points: 8, reading: '8 approved' }, { key: 'packages_done', points: 9, reading: '5 finished' },
{ key: 'verified_accounts', points: 5, reading: '2 of 2 verified' }, { key: 'posting', points: 5, reading: '2.0 posts a week' },
{ key: 'growth', points: 5, reading: '+20% a month' }, { key: 'on_time', points: 7, reading: '7 of 10 on time', provisional: true },
{ key: 'quality', points: 8, reading: '4.0 / 5 average' },
];
export function Score() {
const [open, setOpen] = useState(false);
return (
<div style={{ maxWidth: 380 }}>
<ScoreBreakdown score={91} parts={parts} onExplain={() => setOpen(true)} />
<ScoreExplainer open={open} onClose={() => setOpen(false)} />
</div>
);
}Where it appears
- PR Portal › Creators › creator drawer › TRNDR score card, and "How the TRNDR score works" modal.
- PR Portal › Tiers › score-based ladder links to the explainer (
TierLadder onScoreInfo). - Dashboard screens: PrCreators, PrTiers.
Guidelines
Do
- Pass the backend's parts as they are; send
points: nullfor a part that cannot be measured. - Mark On time and Quality
provisionaluntil the creator has 10 deliveries or ratings. - Format readings in the app ("460K followers", "+20% a month").
Don't
- Don't show 0 for an unmeasured part: it is left out of the score, not counted as zero.
- Don't use it for sales or commission; they are not part of the score.
- Don't show it for customer affiliates with a number: set
track="customer".
RTL and Arabic
Rows mirror; bars fill from the inline start. Arabic words: "تقييم TRNDR", "لسه بنقيس", "عميل", "لسه متقاسش", "مبدئي", "التقييم بيتحسب إزاي"; part names ("المتابعين", "التفاعل", …) come from the copy. Explainer table head is 12px with no letter spacing in Arabic.
Tokens
--line, --r-lg, --card, --ink, --ink-3, --font-family-display, --track, --rasp, --soft.
Accessibility
- A
<section>labelled by its heading; setheadingLevelto keep the outline. - Bars are
aria-hidden; points are written out, with a visually hidden "25 of 25 points" for screen readers. - The value and points are
dir="ltr"so "91 / 100" keeps its order in Arabic. - The explainer is a kit Modal with a real
<table>(scopeon headers).
Found in the source
- ARIA attributes set:
aria-hidden,aria-labelledby. - Its tests cover: “a modal with the nine parts, their points adding up to 100, and the rules; Escape closes it”; “a Card variant=”.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
PrCreatorDrawer: the drawer that holds it.TierLadder basis="score": tiers by score range.ScoreRing(kit): the score alone as a ring in a table cell (the Creators table's Score column).
See also: Card · DetailsBars · Modal · Pill · useLanguage · ScoreExplainer · BulkAction · ChangePreview · ChoiceGroup · DecisionsCard
Source
src/pr/creators/Score.tsx (line 146) on GitHub.