Skip to main content

Figma Storybook

Pill

A small label used to display a count or numeric value, typically attached to another component. Use when you need to show a quantity at a glance. Don't use for status labels or categories — use Badge instead.

Figma Storybook Docs

Description

What it does

Displays a numeric count in a compact, rounded container, typically overlaid or attached to another UI element such as a navigation item, button, or avatar.

Where it appears

Navigation menus (unread notifications), inbox-style list headers (pending items), action buttons (queued tasks), and tab labels (filtered result counts) within Open Point and Social Point admin interfaces.

Why it exists

Government users managing stakeholder lists or consultation responses need an at-a-glance count indicator without navigating into a view. Pill provides that affordance without the semantic weight of a status Badge.

Dependencies

Badge, Button, Avatar

Anatomy

PartRequired?Notes
Container Required Rounded pill shape using --op-radius-pill. Sized to fit content with a minimum width that ensures single-digit counts remain legible and circular.
Count label Required Numeric text rendered at --op-text-xs. Always a whole number — never fractional, currency, or non-numeric.
Overflow indicator Optional When the count exceeds a configured maximum (default 99), renders '99+' to cap display length and prevent layout disruption.

Variants

Default

Neutral count with no urgency implied

General-purpose count on navigation items, tabs, or list headers where the number is informational only.

Emphasis

Draws attention to a non-zero count that warrants action

Use when the count represents items requiring user action, such as pending approvals or unread messages in an engagement inbox.

Muted

Subdued count that is secondary to surrounding content

Use inside dense layouts where the count is contextual rather than actionable, such as a total record count alongside a search result list.

States

State Behaviour
Default Displays the numeric value. Visible at all times when count is greater than zero.
Zero / hidden When count is 0, the pill is not rendered. Do not render an empty pill — remove it from the DOM or set display:none to avoid redundant whitespace.
Overflow When count exceeds the configured maximum (default 99), display the maximum followed by a '+' character (e.g. '99+'). The parent element's accessible label must expose the true meaning (e.g. 'more than 99 unread') for screen reader users.
Loading When the count is being fetched asynchronously, omit the pill entirely or use a skeleton placeholder. Do not show '0' while loading.

Usage guidelines

When to use

  • Showing the number of unread notifications on a navigation item.
  • Indicating how many stakeholder submissions are awaiting review on a button or list header.
  • Labelling a tab with a count of filtered results (e.g. 'Pending (4)').
  • Attaching a response count to an avatar in a consultation participant list.

When not to use

  • Conveying status (e.g. 'Active', 'Closed') — use Badge instead.
  • Labelling categories or tags — use Tag instead.
  • Displaying a non-numeric value — use Badge instead.
  • Replacing a full data point within a table cell — display the number inline as plain text.

Do / Don't

Do

Keep the count numeric and whole. Use '99+' when counts exceed your display maximum.

Don't

Display text strings, decimals, or percentages inside a Pill.

Do

Hide the pill when the count reaches zero. An empty or zero pill adds visual noise without meaning.

Don't

Show a '0' pill — it implies something is present when there is nothing.

Do

Pair the pill with its parent element using an accessible label that includes the count (e.g. 'Notifications, 3 unread').

Don't

Rely on visual position alone to convey what the count refers to — screen readers need explicit context.

Do

Use the Emphasis variant sparingly, only when the count represents items that need user action.

Don't

Apply Emphasis styling to every pill — it loses meaning if overused.

Was this page helpful?

Updated 9 September 2026