Status Chip

Status chips that never rely on colour alone, with one shared status map and a tooltip explaining what each status means.

StopsStatus read wrong by colour-blind users

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/status-chip.json

The files land in your project. They're yours to edit.

Usage

status-chip-usage.tsx
import { StatusChip, type DefaultStatus } from "@/components/ui/status-chip"

<StatusChip status={order.status} detail={order.detail} size="sm" />

What it catches

  • Statuses that differ only by colour (each tone has its own icon)
  • Inconsistent meanings across screens (one shared map)
  • Unknown statuses, shown with a fallback meaning
  • What to do next, explained on hover or focus

Props

StatusChip props
PropTypeDefault
status* (required)

The status key, looked up in `statuses`. Unknown keys render a "?" chip and warn in development.

K—
statuses

The app-wide status map. Share one map so a status means the same thing everywhere.

Record<K, StatusDefinition>DEFAULT_STATUSES as Record<string, StatusDefinition> as R…
detail

Details about this instance, shown first in the explanation, e.g. "Card ending 4242 was declined."

string—
size

Chip size.

"sm" | "default""default"
nextLabel

Heading before `next` in the explanation.

string"What to do"
unknownMeaning

Meaning shown for a status missing from the map.

string"This status isn't defined in the app's status map."

* required. Also accepts the native props of <button> (className, aria-*, data-*…), passed through to it.

Accessibility

  • Chip is a button described by its tooltip (aria-describedby, role=tooltip)
  • Escape closes the tooltip
  • Icon shape plus text per tone; danger is the only solid chip
  • Tooltip motion skipped under reduced motion

Only what the source does. Test with your own screen reader and content before shipping.

Limitations

  • Meanings are only as clear as the copy you write
  • Tooltip content is not reachable on touch without focus

What it stops

Status read wrong by colour-blind users

Also known as

status badge · chip · tag · pill · order status · colour blind · a11y · label

Dependencies

Pairs well with