Skip to content

Status Indicator

Compact status readout with a shape-coded status marker and uppercase label. Renders role=status for assistive technologies.

Preview

Installation

$pnpm exec dgadd add ui/status-indicator
[Installs to]src/components/ui/status-indicator[Item]ui/status-indicator

dgadd is not public on npm yet. Until the first release, pack @diffgazer/add from the repository and install that tarball into this app, which is what puts dgadd on pnpm exec.

UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS once packages are available.

Usage

tsx
import { StatusIndicator } from "@/components/ui/status-indicator";export default function StatusIndicatorDefault() {  return (    <div className="flex flex-col gap-4">      <StatusIndicator label={null}>Online</StatusIndicator>      <StatusIndicator status="busy" label={null}>        Busy      </StatusIndicator>      <StatusIndicator status="offline" label={null}>        Offline      </StatusIndicator>      <StatusIndicator pulse={false}>No pulse</StatusIndicator>    </div>  );}

Examples

Inline in a panel header and rows

Preview

API Reference

StatusIndicator

NameTypeDefaultDescription
status"online" | "offline" | "busy""online"Semantic status. Drives the dot shape and color and the default sr-only status word.
pulsebooleantrueAnimate the dot. Only the online status animates; busy and offline never pulse.
labelstring | nullthe status valueScreen-reader status word announced beside the color-only dot. Defaults to the status value; pass null to suppress it when the children already state the status.
childrenReactNodeUppercase label text shown beside the dot.
classNamestringAdditional classes on the root status element.

Accessibility

Notes

Pulse

Pulse defaults to true, but the dot only animates when status='online' (a compound variant in statusIndicatorDotVariants). Set pulse={false} to disable animation. Honors prefers-reduced-motion via motion-reduce:animate-none.

Shape and color

Every status carries its own marker shape so the states stay apart without relying on hue: online is a filled circle (success), busy is a filled square (warning), offline is a hollow circle (muted-foreground). The shape also keeps online readable mid-pulse, when its opacity dips toward the offline tone.

Accessible status word

The marker is decorative (aria-hidden), so the root renders an sr-only status word (defaulting to the status value) for screen-reader users. Override the word with the label prop, or pass label={null} to suppress it when the visible children already state the status.

Live region

The root renders role="status" — an implicit polite live region — so screen readers announce label changes without interrupting.

Source

Install via CLI: pnpm exec dgadd add ui/status-indicator.

Highlighted source loads after this disclosure opens. Browse the source repository.