dolfindevelopers

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.

Terminal
bunx --bun shadcn@4.23.0 add @dolfin/base-status-badge

Also installs: badge, base-theme.

Usage

screen.tsx
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

PropTypeDescription
variantStatusVariant
labelstring | 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.
childrenstring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.Re…
iconLucideIcon
compactbooleanSmall uppercase lettering, as in table status columns.
classNamestring

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.tsx 48 lines