Status badge
ComponentFoundationsStandalone UI
A generic status pill: a tone (neutral, info, success, warning, danger) mapped to Dolfin's status tokens, with the label passed in.
Component: A piece you place inside your own screens: a table, a form, a card or a dialog. You decide the layout around it. Pages vs components
Loading preview…
Installation
Needs the Dolfin registry token. The CLI copies the source into your app.
bunx --bun shadcn@4.23.0 add @dolfin/base-status-badgeAlso installs: badge, base-theme.
Usage
import type { ComponentProps } from "react";
import { StatusBadge } from "@/components/dolfin/base/status-badge";
// Your controller supplies display values, state and callbacks. No SDK provider required.
export function Screen(props: ComponentProps<typeof StatusBadge>) {
return <StatusBadge {...props} />;
}No SDK provider or data fetching. Pass display values, state and callbacks from your application, GraphQL controller or SDK hooks.
API reference
| Prop | Type | Description |
|---|---|---|
variant | StatusVariant | |
label | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | The words to show. Map API states to copy in the caller; this badge never sees a raw state code. |
children | string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re… | |
icon | LucideIcon | |
compact | boolean | Small uppercase lettering, as in table status columns. |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className
Or edit the installed file directly: it is your code. See theming for colours and fonts.
Files
Written to your app by the install command:
components/dolfin/base/status-badge.tsx48 lines