HighlightBadge
The Find card's highlight line (.hl): one reason to look at this creator ("Top 10% seller on TRNDR", "Growing fast · +64% sales this month", "Won 2 challenges", "3.1% engagement") on its own tint, the emoji decorative.
import { HighlightBadge } from '@ergasti/bricks';Examples
Highlights
A one-line reason to look at a creator, with an icon for the kind; onWhite is for use on a white surface.
Code
import { HighlightBadge } from '@ergasti/bricks';
function Kinds() {
return (
<div style={{ display: 'flex', gap: 10, flexWrap: 'wrap' }}>
<HighlightBadge kind="fire">Top 10% seller on TRNDR</HighlightBadge>
<HighlightBadge kind="star">Won 2 challenges</HighlightBadge>
<HighlightBadge kind="spark">2.2% engagement</HighlightBadge>
<HighlightBadge kind="up" onWhite>Growing fast · +64% sales this month</HighlightBadge>
</div>
);
}Props
Prop
Type
Design guidance
How the BRICKS design system uses HighlightBadge. Written in docs/content/components/HighlightBadge.md; the props above are read from the code, which wins where the two disagree.
A small tinted pill with an emoji and one reason to look at a creator ("Top 10% seller on TRNDR", "Growing fast · +64% sales this month"); use it once per creator card or profile.
It is the mock's highlight line (.hl-*, 🔥 📈 🏆 ✨) on Brand › Find creators cards and the mini profile hero. The emoji is decorative; the text carries the meaning. The text comes from the server with its kind.
The four emoji (🔥 📈 🏆 ✨) are the component's intended marks, one of the few emoji the brand book allows: the library draws them itself (aria-hidden), and the badge text carries the meaning. Do not add other emoji next to it.
Anatomy
- Pill:
span.kit-blk-hl.kit-blk-hl--<kind>, inline-flex, padding 5px 12px, radius 99, 12.5px / 700. - Emoji:
i,aria-hidden. - Text: children.
Variants
kind | Emoji / colours | When |
|---|---|---|
'fire' | 🔥 on #FFE9DE, #A2431A | Top seller. |
'up' | 📈 on --ok-bg, --ok | Growing fast. |
'star' | 🏆 on --butter, --butter-ink | Challenge wins. |
'spark' | ✨ on --lilac, --lilac-ink | Engagement. |
onWhite | White pill, centred, 12px above | On a tinted hero (the mini profile). |
States
Static.
Usage
<HighlightBadge kind="fire">Top 10% seller on TRNDR</HighlightBadge>
<HighlightBadge kind="up">Growing fast · +64% sales this month</HighlightBadge>// On the profile hero
<HighlightBadge kind="star" onWhite>Won 2 challenges</HighlightBadge>Where it appears
- Brand › Find creators › creator card and mini profile hero (
FindCreatorCard,CreatorProfilePanel) (BrandFindCreators).
Guidelines
Do
- One badge per creator; a specific, true sentence.
Don't
- Don't use it for status (use
StatusPill) or tiers (useTierChip).
RTL and Arabic
- Emoji stays at the inline start; text in the page language.
Tokens
--ok-bg, --ok, --butter, --butter-ink, --lilac, --lilac-ink, --card.
Accessibility
- A plain
span, not interactive, no role: read as its text in the reading order of the card. - The emoji sits in an
aria-hidden<i>, so screen readers read only the sentence ("Top 10% seller on TRNDR"). The text must say the reason on its own; never pass only a number. - Inside
FindCreatorCardit sits under the card's hit button, so its text is not part of that button's name (the button is named by the creator's name). - Contrast (12.5px / 700): fire
#A2431Aon#FFE9DE5.4:1 (6.3:1 on white withonWhite); up--okon--ok-bg4.6:1 (5.2:1 on white); star--butter-inkon--butter6.0:1; spark--lilac-inkon--lilac6.5:1. - Colour is decoration only; the kinds are told apart by their words.
Found in the source
- ARIA attributes set:
aria-hidden.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
See also: FactsGrid · FollowerBars
Source
src/blocks/creators/HighlightBadge.tsx (line 12) on GitHub.