PlatformPill
One .plat pill: the platform glyph, its name for AT, the follower count in Latin digits, LTR.
import { PlatformPill } from '@ergasti/bricks';Examples
Followers cell
Totals with a per-platform breakdown; a platform with null or 0 is left out.
Code
import { FollowersCell } from '@ergasti/bricks';
function Cell() {
return <FollowersCell followers={{ instagram: 143000, tiktok: 310000, youtube: 56000 }} />;
}Platform pill and list
One platform with its count, or every platform a creator has.
Code
import { PlatformFollowers, PlatformPill } from '@ergasti/bricks';
function Pills() {
return (
<div style={{ display: 'grid', gap: 12 }}>
<PlatformPill platform="instagram" count={48200} />
<PlatformFollowers followers={{ instagram: 48200, tiktok: 120300, youtube: null }} />
</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 platforms, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
instagram | انستجرام | |
tiktok | TikTok | تيك توك |
youtube | YouTube | يوتيوب |
Design guidance
How the BRICKS design system uses PlatformPill. Written in docs/content/components/PlatformPill.md; the props above are read from the code, which wins where the two disagree.
One social platform as a small outlined pill: its glyph and the follower count ("48.2K"); use it to show a creator's reach on one platform.
PlatformPill is the mock's .plat: a 99px-radius pill with a 1px --line border on the card surface, a 13px stroked glyph and 12px 600 text. The platform name is read by assistive tech but not shown; the count is compacted with compactCount (12,900 → "12.9K", 1,200,000 → "1.2M") and kept left to right. The v3 tables use FollowersCell instead; PlatformPill stays for cards and panels.
Anatomy
- Pill (
span.kit-plat,dir="ltr"): inline-flex, padding 3px 9px, gap 5px. - Glyph:
Iconig/tt/yt. - Name (
.kit-sr): "Instagram " (hidden). - Count: compact text.
Variants
platform | Glyph | Name (en / ar) |
|---|---|---|
'instagram' | ig | Instagram / انستجرام |
'tiktok' | tt | TikTok / تيك توك |
'youtube' | yt | YouTube / يوتيوب |
States
| State | Trigger | Look |
|---|---|---|
| Under 1,000 | count < 1000 | The number as is ("850") |
| Thousands | ≥ 1,000 | "12.9K" |
| Millions | ≥ 1,000,000 | "1.2M" |
Types
Also exported: compactCount(n) and the Platform type.
Usage
<PlatformPill platform="instagram" count={48200} />Several, in a creator card (or use PlatformFollowers):
<span className="kit-plats">
<PlatformPill platform="instagram" count={48200} />
<PlatformPill platform="tiktok" count={12900} />
</span>Where it appears
- The mock's
plats()helper (pills per platform) for creator cards; v3 tables moved to.fol(FollowersCell). - Kit gallery; no screen uses it directly today.
Guidelines
Do
- Use
PlatformFollowersto render all platforms with the provider's filter. - Pass raw integers.
Don't
- Don't render a pill for a 0 count;
PlatformFollowersskips those for you.
RTL and Arabic
dir="ltr"on the pill keeps glyph then count; the hidden name uses the Arabic word.
Tokens
--line, --card.
Accessibility
- Read as "Instagram 48.2K"; the glyph is hidden, the name is in hidden text.
Found in the source
- No roles, ARIA attributes or key handling are set in this component's own source; it renders native elements and the components it composes.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
PlatformFollowers: all platforms with followers.FollowersCell: the v3 table cell (total + glyphs).
See also: useBricks · Icon · Avatar · AvatarStack · Button · ButtonLink
Source
src/kit/primitives/PlatformPill.tsx (line 18) on GitHub.