Status
A labelled state pill with an optional pulsing indicator.
Installation
npx shadcn@latest add "@aiellie/status"shadcn needs the @aiellie registry in components.json first. npx aiellie add status adds it on its first run, then installs the same way.
Status is a small pill that says what state something is in: live, done, failed, waiting on you, or idle. A dot leads the word, pulsing while the thing is still going, and the pill takes a tint of the state's color. The word is always there, so the state never rests on color alone.
Getting started
Add a status
Compose it from its dot and its label.
components/deploy-status.tsximport { Status, StatusIndicator, StatusLabel, } from "@/components/ui/status" export function DeployStatus({ running }: { running: boolean }) { return ( <Status variant={running ? "live" : "success"} pulse={running}> <StatusIndicator /> <StatusLabel>{running ? "Deploying" : "Deployed"}</StatusLabel> </Status> ) }
Anatomy
<span data-slot="status" data-variant="live" data-pulse="true"> {/* render, a span by default */}
<span data-slot="status-indicator"> {/* a 6px dot, with a ring and a ping while pulsing */}
<span data-slot="status-label" />
</span>The pill is 12px text in the state's color on a 4% tint of it, with a hairline border. live, success and pending use the aiellie theme's tokens of those names, and destructive uses shadcn's. pending is amber, for something waiting on the person, like an approval; it never pulses. Anything else, like queued, draft or idle, is muted: neutral, on a muted fill. The ping stops with reduced motion, and the dot stays.
Use pulse for something still running, and leave it off once it has finished. statusVariants is exported for a pill of your own that should look the same.
Examples
A task's state
Neutral while queued, pulsing while it runs, amber while it waits on you, and still once it has an outcome.
As a link
render makes the pill another element, like a link to the status page.
<Status variant="destructive" render={<a href="https://status.example.com" />}>
<StatusIndicator />
<StatusLabel>Degraded</StatusLabel>
</Status>API reference
Status
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "live" | "success" | "destructive" | "pending" | "muted" | "live" | The state, and its color. |
pulse | boolean | false | Pings the dot, for something still going. |
render | ReactElement | <span /> | The element it renders as. |
className | string | Merged onto the pill. |
Parts
| Export | Renders | Notes |
|---|---|---|
StatusIndicator | span | The dot, in the state's color. |
StatusLabel | span | The word, truncated when there's no room. |
statusVariants | cva | The pill's classes by variant. |