Atoms

Status Dot

A static dot indicator of status, with the Badge Status variants.

Formance
Docs

Installation#

npx shadcn@latest add @formance/status-dot

Install the following dependencies:

npm install class-variance-authority

Copy and paste the following code into your project.

Update the import paths to match your project setup.

Usage#

import { StatusDot } from '@/components/ui/status-dot'
<StatusDot variant="valid">Active</StatusDot>

Examples#

Label#

Best practices#

  • Use the same variants as Badge Status: valid, destructive, info, warning, zinc (default) and outline. Use the dot where a badge takes too much space, for example in a table cell or a list row.
  • The dot is static. Do not add a spinner next to it.
  • Give the status as text next to the dot: the colour must not be the only signal. Do not add text such as Status: Active: the label gives the status.
  • The component draws the first letter of the label in upper case: ready shows as Ready. It does not change the other letters, so an acronym such as EBICS stays the same. Give the label in sentence case when you can.
  • When the dot has no text, give it a name: <StatusDot variant="valid" role="img" aria-label="Active" />.