StartFoundationsComponentsContent

Badge

A badge shows a status or a count at a glance: a short label, a number, or a dot. It is content, not a control.

Stable Figma
OverviewUsageAPIAccessibility
Active
<tk-badge tone="success">Active</tk-badge>
<tk-badge tone="error" treatment="solid" count="120" label="120 unread notifications"></tk-badge>
<tk-badge dot tone="success" label="Online"></tk-badge>

Anatomy

A badge is one of three kinds. If you set more than one, dot wins over count, and count wins over the label.

Kind Height What it is
label (default slot) 20px a pill with one or two words of status
count 16px a pill with a number; above max it shows "99+"
dot 8px a colored dot with no text

Tones and treatments

Draft In review Stable Expiring Failed
<tk-badge>Draft</tk-badge>
<tk-badge tone="info">In review</tk-badge>
<tk-badge tone="success">Stable</tk-badge>
<tk-badge tone="warning">Expiring</tk-badge>
<tk-badge tone="error">Failed</tk-badge>

tone sets the meaning: neutral (default), info, success, warning, or error.

treatment="solid" fills the badge instead of tinting it. Keep subtle (default) for most badges and use solid for notification counts and status that must stand out. treatment doesn't apply to a dot.

Draft Stable
<tk-badge treatment="solid">Draft</tk-badge>
<tk-badge treatment="solid" tone="success">Stable</tk-badge>
<tk-badge treatment="solid" tone="error" count="3" label="3 failed checks"></tk-badge>

Counts

<tk-badge count="3" label="3 updates"></tk-badge>
<tk-badge count="42" label="42 updates"></tk-badge>
<tk-badge count="120" label="120 updates"></tk-badge>
  • max (default 99) caps the number: 120 shows as "99+".
  • count="0" still shows. Hide the badge yourself when there's nothing to count.
  • Next to a named target, such as a Notifications button, the number is enough. Alone, give it a label.

Dots

<tk-badge dot tone="success" label="Online"></tk-badge>
<tk-badge dot tone="warning" label="Away"></tk-badge>
<tk-badge dot></tk-badge>

A dot is silent to screen readers by default. If it means something, such as online or has updates, set label or place it next to text that says the same thing. Color alone isn't enough.

On an avatar

Put a badge in an Avatar's badge slot. The avatar places it: a count at the top corner, a dot or label at the bottom. Use one badge per avatar. A dot fits avatars from 24 to 48px; a count reads best on 40px and larger.

<tk-avatar shape="circle" name="Mira Petrova"><tk-badge slot="badge" dot tone="success" label="Online"></tk-badge></tk-avatar>
<tk-avatar size="40" shape="circle" name="Ada Lovelace"><tk-badge slot="badge" count="5" tone="error" treatment="solid" label="5 unread messages"></tk-badge></tk-avatar>