Workflow Status
Compact workflow badges with semantic defaults, custom states, icon and colour overrides, two sizes, and an icon-only form.
With labels
Icon only
Installation
Workflow Status is published as a shadcn registry item. The CLI drops the file into your project, installs its dependencies, and adds any primitives it relies on.
$npx shadcn@latest add @akoder/workflow-statusThe @akoder namespace ships with the shadcn CLI, so there is nothing to configure first. Install any other component the same way from the components page.
Usage
The component includes seven workflow states: pending, in-progress, submitted, in-review, success, failed, and expired.
Custom labels
Use label when the state needs product-specific language. The semantic colour and icon remain tied to the selected state.
Compact size
Use size="sm" to reduce the badge height, spacing, text, and icon size in dense layouts.
Icon only
For dense interfaces, render the icon-only form. It works with either size. The state label stays in the accessibility tree as visually hidden text, so screen readers still announce it and no aria-label is needed.
Custom states
Pass any status string and provide an icon and colour classes for product-specific states. If label is omitted, values such as awaiting_payment are displayed as “Awaiting payment”.
The exported workflowStatusPresentations map is available when filters, menus, or other UI need to reuse the built-in presentation metadata.
Status labels
getWorkflowStatusLabel returns the default or inferred label for a state, so filters and legends beside the badge can reuse the same copy instead of duplicating it.
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
status | WorkflowStatusValue | required | Selects a built-in state or identifies a custom state. |
label | string | state label | Replaces the visible and accessible label. |
icon | LucideIcon | state icon | Replaces the built-in icon. Custom states fall back to CircleDashed. |
colorClassName | string | state colours | Replaces the badge background and foreground colour classes. |
iconClassName | string | Adds classes to the icon without changing the badge. | |
size | "sm" | "default" | "default" | Reduces the badge and icon footprint when set to "sm". |
iconOnly | boolean | false | Renders a circular badge without visible text. |
className | string | Extra classes for placement and spacing. |
Notes & features
- Semantic states. Every built-in state pairs a distinct icon and colour, so users do not need to decode colour alone.
- No wrapper. The component only renders the badge. Use a list, table, or card around it according to your layout.
- Accessible by default. The icon is decorative and the visible label carries the state. Icon-only badges keep that label as visually hidden text rather than an
aria-label, which is not reliably exposed on a generic element. - Custom states. Use any status string with
iconandcolorClassName, or reuse and extend the exportedworkflowStatusPresentationsmap. - Predictable overrides. Colour overrides are explicit through
colorClassName; layout overrides remain inclassName. Both merge throughtailwind-merge. - Reduced motion. Only the in-progress icon spins. Operating-system reduced-motion preferences stop the browser animation.
Manual installation
Rather not use the CLI? Everything Workflow Status needs is below. Install its dependencies, then copy the file into the matching path in your project.
Dependencies
$npm install lucide-react clsx tailwind-mergeSource