@dax-ui/status-tag
v0.8.0
Published
dax-ui StatusTag: outlined status pills with a dot (Done, On Hold, In Progress, Inactive, Overdue) in 18, 24 and 28px
Maintainers
Readme
@dax-ui/status-tag
Outlined status pills with a colored dot: Done, On Hold, In Progress, Inactive and Overdue,
in three sizes. Built on @dax-ui/chip; colors follow the app's theme.
Installation
pnpm add @dax-ui/status-tagMUI and Emotion are included; the app only needs React 18 or 19.
One-time setup per app (skip if the app already uses dax-ui): install
@dax-ui/theme and wrap the app in its UIProvider.
pnpm add @dax-ui/themeUsage
import { StatusTag } from '@dax-ui/status-tag';
<StatusTag status="inProgress" />
<StatusTag status="overdue" label="Overdue 3 days" />Statuses
| status | Label | Color |
| --- | --- | --- |
| done | Done | success (green) |
| onHold | On Hold | warning (amber) |
| inProgress | In Progress | info (blue) |
| inactive | Inactive | neutral (gray) |
| overdue | Overdue | danger (red) |
label replaces the text and keeps the color; color replaces the color.
Statuses of your own
Leave out status and give a label, with a color (a Chip preset or any CSS color; gray
without one):
<StatusTag label="Cancelled" color="#9333ea" />
<StatusTag label="Scheduled" color="teal" />
<StatusTag label="Draft" />Sizes
| size | Height | Use for |
| --- | --- | --- |
| sm | 18px | Compact tables, dense layouts and metadata |
| md (default) | 24px | Standard status indicators across the application |
| lg | 28px | Prominent statuses in detail pages, cards and summaries |
Props
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| aria-label | string | | Accessible name of a clickable chip or link, when the label alone isn't enough. |
| className | string | | Class name on the root element. |
| color | ChipPresetColor \| (string & {}) | | Replaces the status's color: a Chip preset (success, warning, info, neutral, danger, brand, teal) or any CSS color. |
| colors | Partial<ChipColors> | | Overrides any of the chip's colors, e.g. { border: '#14b8a6' }. Unset keys come from color and variant. |
| disabled | boolean | false | Dims the chip and disables its buttons. |
| dot | boolean | true | Shows the dot before the label. |
| href | string | | Makes the chip a link to this URL. |
| icon | ReactNode | | Icon before the label, e.g. <FlagIcon />. Decorative: hidden from screen readers. |
| label | ReactNode | the status name, e.g. 'In Progress' | Text of the tag. Required without status. |
| maxWidth | string \| number | | Longest the chip may grow, in px or any CSS length; longer labels end in "…". |
| onClick | ((event: MouseEvent<HTMLElement, MouseEvent>) => void) | | Makes the chip a button, e.g. for filters. |
| selected | boolean | false | Marks a clickable chip as selected (a toggle, aria-pressed): it switches to the solid look. |
| size | "sm" \| "md" \| "lg" | md | Height: sm 18px for compact tables, dense layouts and metadata; md 24px for status across the app; lg 28px for detail pages, cards and summaries. |
| status | "done" \| "onHold" \| "inProgress" \| "inactive" \| "overdue" | | A built-in status: done (green), onHold (amber), inProgress (blue), inactive (gray) or overdue (red). Sets the color and the default label. Leave it out for a status of your own, with label (required then) and color (gray by default). |
| style | CSSProperties | | Inline styles on the root element. |
| sx | SxProps<Theme> | | Style overrides on the root element. |
| target | string | | With href: where to open the link, e.g. '_blank'. |
Run pnpm docs to fill in the table above from the JSDoc in src/StatusTag.types.ts.
