UI Interface
Badges, avatars and indicators
Small status and feedback components: badges and pills, delta indicators, status dots, removable tags, counters, avatars, progress bars and rings, ratings, keyboard keys, tooltips and skeleton loaders. Open the Code panel under any preview to copy the markup.
Badges and pills
sx-badge reads data-tone. Soft is the default, add --solid for emphasis, --dot for status, --sm for dense tables.
Dark mode brightens the soft foreground and deepens the tint automatically. Solid badges use white text, so keep the label short.
<div class="ui-row"><span class="ui-lab">Soft</span>
<span class="sx-badge" data-tone="primary">Primary</span>
<span class="sx-badge" data-tone="success">Success</span>
<span class="sx-badge" data-tone="warning">Warning</span>
<span class="sx-badge" data-tone="danger">Danger</span>
<span class="sx-badge" data-tone="info">Info</span>
<span class="sx-badge" data-tone="accent">Accent</span>
<span class="sx-badge" data-tone="violet">Violet</span>
<span class="sx-badge" data-tone="orange">Orange</span>
<span class="sx-badge" data-tone="blue">Blue</span>
<span class="sx-badge" data-tone="pink">Pink</span>
<span class="sx-badge" data-tone="neutral">Neutral</span>
</div>
<div class="ui-row"><span class="ui-lab">Solid</span>
<span class="sx-badge sx-badge--solid" data-tone="primary">Primary</span>
<span class="sx-badge sx-badge--solid" data-tone="success">Success</span>
<span class="sx-badge sx-badge--solid" data-tone="warning">Warning</span>
<span class="sx-badge sx-badge--solid" data-tone="danger">Danger</span>
<span class="sx-badge sx-badge--solid" data-tone="info">Info</span>
<span class="sx-badge sx-badge--solid" data-tone="accent">Accent</span>
<span class="sx-badge sx-badge--solid" data-tone="violet">Violet</span>
<span class="sx-badge sx-badge--solid" data-tone="orange">Orange</span>
<span class="sx-badge sx-badge--solid" data-tone="blue">Blue</span>
<span class="sx-badge sx-badge--solid" data-tone="pink">Pink</span>
<span class="sx-badge sx-badge--solid" data-tone="neutral">Neutral</span>
</div>
<div class="ui-row"><span class="ui-lab">Dot</span>
<span class="sx-badge sx-badge--dot" data-tone="primary">Primary</span>
<span class="sx-badge sx-badge--dot" data-tone="success">Success</span>
<span class="sx-badge sx-badge--dot" data-tone="warning">Warning</span>
<span class="sx-badge sx-badge--dot" data-tone="danger">Danger</span>
<span class="sx-badge sx-badge--dot" data-tone="info">Info</span>
<span class="sx-badge sx-badge--dot" data-tone="accent">Accent</span>
<span class="sx-badge sx-badge--dot" data-tone="violet">Violet</span>
<span class="sx-badge sx-badge--dot" data-tone="orange">Orange</span>
<span class="sx-badge sx-badge--dot" data-tone="blue">Blue</span>
<span class="sx-badge sx-badge--dot" data-tone="pink">Pink</span>
<span class="sx-badge sx-badge--dot" data-tone="neutral">Neutral</span>
</div>
<div class="ui-row"><span class="ui-lab">Small</span>
<span class="sx-badge sx-badge--sm" data-tone="primary">Primary</span>
<span class="sx-badge sx-badge--sm" data-tone="success">Success</span>
<span class="sx-badge sx-badge--sm" data-tone="warning">Warning</span>
<span class="sx-badge sx-badge--sm" data-tone="danger">Danger</span>
<span class="sx-badge sx-badge--sm" data-tone="info">Info</span>
<span class="sx-badge sx-badge--sm" data-tone="accent">Accent</span>
<span class="sx-badge sx-badge--sm" data-tone="violet">Violet</span>
</div>
Badges with icons, shapes and context
Add leading icons, switch to a squarer radius with a utility, or use the page-local outline style. Real-world status examples below.
INV-2026-0418
Northwind Labs · $4,280.00
<span class="sx-badge" data-tone="success"><i class="icon-circle-check"></i>Paid</span>
<span class="sx-badge rounded-md sx-badge--solid" data-tone="orange">Hot</span>
<span class="sx-badge ui-badge-out" data-tone="primary">Primary</span>
<style>
.ui-badge-out { background: transparent; color: var(--tone-fg); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--tone) 45%, transparent); }
</style>
Delta indicators
sx-delta shows change with direction. is-up and is-down pick success and danger tones; a data-tone overrides them. sx-delta-text is the plain-text version.
Monthly revenue
$114,280 in October
Churn rate
Lower is better, so a drop is green
Colour follows meaning, not arrow direction: a falling churn rate is good, so it uses is-up with a down arrow. Always show the sign or an arrow, never colour alone.
<div class="ui-row"><span class="ui-lab">Pills</span>
<span class="sx-delta is-up"><i class="icon-trending-up"></i>12.4%</span>
<span class="sx-delta is-down"><i class="icon-trending-down"></i>3.1%</span>
<span class="sx-delta is-up"><i class="icon-arrow-up-right"></i>+$2,140</span>
<span class="sx-delta is-down"><i class="icon-arrow-down-right"></i>-8 tickets</span>
<span class="sx-delta" data-tone="neutral"><i class="icon-minus"></i>0.0%</span>
<span class="sx-delta" data-tone="warning"><i class="icon-trending-down"></i>-0.6 pts</span>
<span class="sx-delta" data-tone="info"><i class="icon-arrow-up"></i>5 new</span>
<span class="sx-delta is-up h-[18px] px-1.5 text-[10.5px]">+4%</span>
</div>
<div class="ui-row"><span class="ui-lab">Text</span>
<span class="sx-delta-text is-up">+18.2%</span>
<span class="sx-delta-text is-down">-2.7%</span>
<span class="text-[12.5px] text-[var(--text-tertiary)]">vs last month</span>
</div>
<div class="ui-row"><span class="ui-lab">In a KPI</span>
<div class="rounded-xl border border-[var(--border-subtle)] bg-[var(--surface-raised)] p-4 min-w-[220px]">
<p class="sx-eyebrow">Monthly revenue</p>
<div class="mt-1.5 flex items-end gap-2"><span class="text-[26px] font-extrabold tracking-tight sx-num">$128,450</span><span class="sx-delta is-up mb-1"><i class="icon-trending-up"></i>12.4%</span></div>
<p class="mt-1 text-[12px] text-[var(--text-tertiary)]">$114,280 in October</p>
</div>
<div class="rounded-xl border border-[var(--border-subtle)] bg-[var(--surface-raised)] p-4 min-w-[220px]">
<p class="sx-eyebrow">Churn rate</p>
<div class="mt-1.5 flex items-end gap-2"><span class="text-[26px] font-extrabold tracking-tight sx-num">2.8%</span><span class="sx-delta is-up mb-1"><i class="icon-trending-down"></i>0.4 pts</span></div>
<p class="mt-1 text-[12px] text-[var(--text-tertiary)]">Lower is better, so a drop is green</p>
</div>
</div>
Status dots
sx-dot is an 8px marker coloured by --c. Pair with a text label; use sx-live for a pulsing real-time indicator.
Never rely on colour alone: add a text label or aria-label. Animations stop for users who prefer reduced motion.
<span class="sx-dot" style="--c: var(--sx-success)"></span> Online
<span class="sx-live"></span> Live
<span class="sx-dot ui-pulse" style="--c: var(--sx-danger)"></span> Recording
<style>
.ui-pulse { position: relative; }
.ui-pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; animation: sx-ping 1.8s ease-out infinite; }
</style>
Counters
Small numeric pills for unread counts and totals: standalone, in navigation, on icons and in tabs.
- Inbox6
- Starred14
- Sent
Cap large numbers (99+) in tight spaces and put the exact number in the aria-label.
<span class="ui-count">3</span>
<span class="ui-count ui-count--soft" data-tone="primary">24</span>
<button type="button" class="sx-btn sx-btn--outline sx-btn--icon relative" aria-label="Notifications, 5 unread">
<i class="icon-bell"></i><span class="ui-count ui-count--pin">5</span>
</button>
<style>
.ui-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding-inline: 6px; border-radius: 99px; background: var(--sx-danger); color: #fff; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.ui-count--soft { background: var(--tone-bg); color: var(--tone-fg); }
.ui-count--pin { position: absolute; inset-block-start: -7px; inset-inline-end: -7px; box-shadow: 0 0 0 2px var(--surface-raised); }
.ui-count--dot { min-width: 10px; width: 10px; height: 10px; padding: 0; inset-block-start: -3px; inset-inline-end: -3px; }
</style>
Avatars
Initials avatars take any tone. Sizes sm to xl, presence dots, status rings, overlapping stacks and +N overflow.
+5
+5
Hover or focus a member in the group to read the tooltip. Photo avatars use the same sx-avatar class with an img element.
<span class="sx-avatar sx-avatar--ini" data-tone="violet">DR</span>
<!-- presence -->
<span class="ui-pres" data-status="online"><span class="sx-avatar sx-avatar--ini sx-avatar--lg" data-tone="success">MC</span></span>
<!-- status ring -->
<span class="ui-ring" data-tone="primary"><span class="sx-avatar sx-avatar--ini sx-avatar--lg" data-tone="primary">DR</span></span>
<!-- stack with overflow and tooltips -->
<div class="sx-avatars ui-hoverstack" role="group" aria-label="Project members">
<span class="sx-avatar sx-avatar--ini" data-tone="primary" data-tip="Maya Chen" tabindex="0" role="img" aria-label="Maya Chen">MC</span>
<span class="sx-avatar sx-avatar--ini" data-tone="neutral" data-tip="3 more" tabindex="0" role="img" aria-label="3 more">+3</span>
</div>
<style>
.ui-pres { position: relative; display: inline-flex; }
.ui-pres::after { content: ""; position: absolute; inset-block-end: 0; inset-inline-end: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--color-neutral-400); box-shadow: 0 0 0 2px var(--surface-raised); }
.ui-pres[data-status="online"]::after { background: var(--sx-success); }
.ui-pres[data-status="away"]::after { background: var(--sx-warning); }
.ui-pres[data-status="busy"]::after { background: var(--sx-danger); }
.ui-ring { display: inline-flex; padding: 2px; border-radius: 50%; box-shadow: 0 0 0 2px var(--tone), 0 0 0 4px var(--surface-raised) inset; }
.ui-hoverstack > * { position: relative; transition: transform .15s; }
.ui-hoverstack > *:hover, .ui-hoverstack > *:focus-visible { transform: translateY(-3px); z-index: 2; }
</style>
Progress bars, rings and stacks
sx-bar fills to --v (a percentage), sx-ring fills a conic gradient from --v (a number), and sx-stack splits a total by weight.
Thin (sm)
Default
Large (lg)
Stepped (3 of 5)
Use success, warning and danger tones only when the value has that meaning. The bar animates its width when --v changes.
<div class="sx-bar sx-bar--lg" data-tone="success" role="progressbar" aria-valuenow="82" aria-valuemin="0" aria-valuemax="100" aria-label="Goal 82%">
<span style="--v: 82%"></span>
</div>
<div class="sx-stack" role="img" aria-label="Storage by type">
<span class="sx-c1" style="--w: 28"></span>
<span class="sx-c2" style="--w: 21"></span>
<span class="sx-c3" style="--w: 10"></span>
</div>
<span class="sx-ring" role="img" aria-label="72 percent" style="--v: 72; --size: 96px; --thick: 10px" data-tone="primary">
<span class="sx-num">72%</span>
</span>
Ratings
Phosphor fill stars in the warning tone. Read-only display for reviews, plus an interactive picker built from buttons.
<span class="ui-stars" role="img" aria-label="Rated 4.5 out of 5">
<i class="ph-fill ph-star"></i><i class="ph-fill ph-star"></i><i class="ph-fill ph-star"></i><i class="ph-fill ph-star"></i><i class="ph-fill ph-star-half"></i>
</span>
<div class="ui-stars ui-stars--lg ui-pick" data-ui-rating role="group" aria-label="Rate this article">
<button type="button" data-v="1" aria-label="1 star" aria-pressed="false"><i class="ph ph-star"></i></button>
<!-- ...up to data-v="5" -->
</div>
<style>
.ui-stars { display: inline-flex; gap: 2px; font-size: 16px; color: var(--sx-warning); }
.ui-stars .off { color: var(--border-strong); }
.ui-stars--sm { font-size: 13px; } .ui-stars--lg { font-size: 22px; }
.ui-pick button { display: inline-flex; color: var(--border-strong); transition: transform .12s, color .12s; }
.ui-pick button:hover { transform: scale(1.18); color: var(--sx-warning); }
.ui-pick button.is-on { color: var(--sx-warning); }
</style>
Keyboard keys (sx-kbd)
Render shortcuts as raised keycaps. Combine several keys with a plus sign or a thin space.
Use the semantic kbd element. Spell out modifier names, since the symbol for Command or Option may not render on every system.
<div class="ui-row"><span class="ui-lab">Single</span>
<kbd class="sx-kbd">Esc</kbd><kbd class="sx-kbd">Tab</kbd><kbd class="sx-kbd">Enter</kbd><kbd class="sx-kbd">Space</kbd><kbd class="sx-kbd">/</kbd><kbd class="sx-kbd"><i class="icon-arrow-up"></i></kbd><kbd class="sx-kbd"><i class="icon-arrow-down"></i></kbd><kbd class="sx-kbd"><i class="icon-corner-down-left"></i></kbd>
</div>
<div class="ui-row"><span class="ui-lab">Combos</span>
<span class="inline-flex items-center gap-1"><kbd class="sx-kbd">Ctrl</kbd><span class="text-[var(--text-tertiary)]">+</span><kbd class="sx-kbd">K</kbd></span>
<span class="inline-flex items-center gap-1"><kbd class="sx-kbd">Ctrl</kbd><span class="text-[var(--text-tertiary)]">+</span><kbd class="sx-kbd">Shift</kbd><span class="text-[var(--text-tertiary)]">+</span><kbd class="sx-kbd">P</kbd></span>
<span class="inline-flex items-center gap-1"><kbd class="sx-kbd">Alt</kbd><span class="text-[var(--text-tertiary)]">+</span><kbd class="sx-kbd">N</kbd></span>
</div>
<div class="ui-row"><span class="ui-lab">In context</span>
<button type="button" class="sx-btn sx-btn--outline"><i class="icon-search"></i>Search<kbd class="sx-kbd ms-3">Ctrl K</kbd></button>
<button type="button" class="sx-btn sx-btn--primary">Save<kbd class="sx-kbd !bg-transparent !text-white !border-white/40 ms-1">Ctrl S</kbd></button>
<div class="w-full max-w-xs rounded-xl border border-[var(--border-subtle)] bg-[var(--surface-raised)] p-1.5 text-[13px]">
<div class="flex items-center gap-2 rounded-lg px-2.5 py-2"><i class="icon-copy text-[var(--text-tertiary)]"></i>Duplicate<kbd class="sx-kbd ms-auto">Ctrl D</kbd></div>
<div class="flex items-center gap-2 rounded-lg px-2.5 py-2"><i class="icon-pencil text-[var(--text-tertiary)]"></i>Rename<kbd class="sx-kbd ms-auto">F2</kbd></div>
<div class="flex items-center gap-2 rounded-lg px-2.5 py-2"><i class="icon-trash-2 text-[var(--text-tertiary)]"></i>Delete<kbd class="sx-kbd ms-auto">Del</kbd></div>
</div>
</div>
Tooltips (data-tip)
Add data-tip="Text" to any element. The shell shows a themed tooltip on hover and keyboard focus, placed to the right of the element.
Ctrl K
Tooltips should add detail, not carry essential content. Elements that are not natively focusable need tabindex="0" so keyboard users can reach the tip. The tip is currently placed to the right only, so avoid it at the right edge of the viewport.
<div class="ui-row"><span class="ui-lab">Buttons</span>
<button type="button" class="sx-btn sx-btn--outline sx-btn--icon" data-tip="Copy link" aria-label="Copy link"><i class="icon-link"></i></button>
<button type="button" class="sx-btn sx-btn--outline sx-btn--icon" data-tip="Download report" aria-label="Download report"><i class="icon-download"></i></button>
<button type="button" class="sx-btn sx-btn--outline sx-btn--icon" data-tip="Archive project" aria-label="Archive project"><i class="icon-archive"></i></button>
<button type="button" class="sx-btn sx-btn--primary" data-tip="Publishes to production">Deploy</button>
</div>
<div class="ui-row"><span class="ui-lab">Inline</span>
<span class="sx-badge" data-tone="info" data-tip="Visible to workspace admins only" tabindex="0"><i class="icon-shield-check"></i>Admin</span>
<span class="inline-flex items-center gap-1 text-[13px]">Monthly recurring revenue <i class="icon-info text-[var(--text-tertiary)] cursor-help" data-tip="Normalised subscription revenue per month" tabindex="0" aria-label="About monthly recurring revenue"></i></span>
<span class="sx-avatar sx-avatar--ini" data-tone="violet" data-tip="Diego Ramos" tabindex="0">DR</span>
<span class="sx-kbd" data-tip="Open command palette" tabindex="0">Ctrl K</span>
</div>
Skeleton loaders
Placeholder shapes with a soft shimmer while content loads. Toggle the preview to compare with the loaded state.
Diego Ramos
Product designer · Austin, TX
Leads the design system and onboarding experience. Shipped 14 releases this year and mentors two junior designers on the platform team.
Recent invoices
- $4,280
Northwind Labs
INV-0418 · Nov 9
- $1,950
Harbor & Pine
INV-0417 · Nov 7
- $7,400
Orbit Studio
INV-0416 · Nov 3
Match the skeleton to the final layout to avoid content jumping. Mark the container aria-busy while loading.
<div aria-busy="true" aria-label="Loading profile">
<div class="flex items-center gap-3">
<span class="ui-sk ui-sk--circle w-11 h-11"></span>
<div class="grid gap-2 flex-1"><span class="ui-sk ui-sk--line w-1/2"></span><span class="ui-sk ui-sk--line w-1/3 !h-2.5"></span></div>
</div>
<span class="ui-sk ui-sk--block w-24 h-9"></span>
</div>
<style>
.ui-sk { display: block; background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--border-subtle) 50%, var(--surface-sunken) 75%); background-size: 200% 100%; animation: ui-shimmer 1.4s ease-in-out infinite; }
.ui-sk--line { height: 12px; border-radius: 6px; }
.ui-sk--circle { border-radius: 50%; }
.ui-sk--block { border-radius: 10px; }
@keyframes ui-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ui-sk { animation: none; } }
</style>
Usage tips and accessibility
Guidelines worth following across the whole template
Usage tips
- Choose a tone for its meaning: success for good, warning for attention, danger for errors, neutral for plain metadata.
- Prefer soft badges in tables and solid badges for one or two highlights per screen.
- Keep badge labels to one or two words and use sx-badge--sm in dense lists.
- Stack at most five avatars, then show +N with the full list in a tooltip or popover.
- Show a skeleton only when content takes longer than about 300ms to arrive.
Accessibility
- Never rely on colour alone: pair dots, deltas and rings with text, icons or an aria-label.
- Progress bars and rings expose role="progressbar" or role="img" with a readable value.
- Tooltips open on focus as well as hover; add tabindex="0" to non-interactive triggers.
- Remove buttons carry an aria-label naming the tag they delete.
- Skeleton containers use aria-busy and shimmer animations stop under prefers-reduced-motion.