Components
Metrics
6 components. Every one is themeable, keyboard operable, and configurable by data attribute, JSON or JavaScript.
Metrics
Achievement Badges
Milestones earned, with locked ones shown honestly rather than hidden.
achievement-badgesdefaultearnedlockedloadingempty
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items |
array |
[] |
[{ label, icon, description?, earned?, date? }] |
title |
string |
— | Section heading. |
showLocked |
boolean |
true |
Show unearned badges dimmed, with what unlocks them. |
loading |
boolean |
false |
Renders the skeleton state, preserving the final layout exactly so nothing shifts on resolve. |
Accessibility
- Locked badges say "Locked" in text — dimming alone is not a state a screen reader can perceive.
- Each badge is a list item with one accessible name combining the title, its state and how it was earned.
Design tokens
--lb-surface-2 --lb-outline --lb-on-surface-3
Metrics
Click Count
How often a link has been followed, optionally as a share of the total.
click-countdefault
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
valuerequired |
number |
— | Clicks on this link. |
total |
number |
— | Total clicks, to show a share bar. |
label |
string |
"clicks" |
Unit word. |
showBar |
boolean |
false |
Draws a share bar. Requires total. |
Accessibility
- The share bar is decorative and aria-hidden — the percentage is stated in text beside it.
- Percentages are rounded once, so the bar and the label can never disagree.
Design tokens
--lb-surface-3 --lb-primary
Metrics
Follower Count
Audience size with an optional change since last period.
follower-countdefaultrisingfalling
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
valuerequired |
number |
— | Current followers. |
label |
string |
"Followers" |
What the number counts. |
change |
number |
— | Change since the last period. Negative values are shown as a fall. |
changePeriod |
string |
"this month" |
The window the change covers. |
platform |
string |
— | Simple Icons slug for the source. |
compact |
boolean |
true |
Abbreviate the figure. |
Accessibility
- A delta carries an arrow and a sign as well as its colour, so direction is never hue alone (WCAG 1.4.1).
- The change is announced as a phrase — "up 1,204 this month" — rather than a bare signed number.
Design tokens
--lb-success --lb-on-surface-3 --lb-type-h3
Metrics
Live Activity
What is happening right now — people online, or the latest few actions.
live-activitydefaultloadingempty
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
count |
number |
— | People here now. |
label |
string |
"here now" |
Unit phrase. |
items |
array |
[] |
[{ text, time }] — recent activity, newest first. |
pulse |
boolean |
true |
Animates the presence dot. Held still under reduced motion. |
loading |
boolean |
false |
Renders the skeleton state, preserving the final layout exactly so nothing shifts on resolve. |
Accessibility
- The region is polite, not assertive: live figures should never interrupt what someone is reading.
- The pulse is decoration on top of a dot that is already visible, so reduced motion loses nothing.
Design tokens
--lb-success --lb-surface --lb-outline-soft
Metrics
View Count
Views on one item, as an inline figure rather than a card.
view-countdefault
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
valuerequired |
number |
— | View count. |
label |
string |
"views" |
Unit word. |
compact |
boolean |
true |
Abbreviate the figure. |
variant |
string |
"inline" |
Visual treatment. All variants share one behaviour and one API. One of: inline, pill |
Accessibility
- Inline figures are one element with one accessible name, so the number and its unit are never split across two announcements.
- Tabular numerals stop a row of counts from shifting as values change.
Design tokens
--lb-on-surface-3 --lb-type-body-xs
Metrics
Visitor Counter
How many people have been here, with an optional period.
visitor-counterdefaultloading
Preview
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
valuerequired |
number |
— | Total visitors. |
label |
string |
"Visitors" |
What the number counts. |
period |
string |
— | Over what window, e.g. "this month". |
compact |
boolean |
true |
Abbreviate — 12.8K rather than 12,847. |
animate |
boolean |
false |
Counts up on first paint. Skipped under reduced motion. |
loading |
boolean |
false |
Renders the skeleton state, preserving the final layout exactly so nothing shifts on resolve. |
Accessibility
- The exact figure is always in the accessible name, whatever the display shows.
- The count-up animation never changes the announced value, because a live-updating number would flood a screen reader.
Design tokens
--lb-type-h3 --lb-on-surface-3