[ Data Display ]
StatusChip
A soft, tinted chip with an icon for statuses like Queued, Scheduled or In progress. Pass onClick to turn it into a toggle (selected adds a ring and aria-pressed), so a row of chips becomes a filter bar.
3 examplesDark modeAccessible
Import#
import { StatusChip } from 'reusify-ui';When to use#
- Showing the status of a job, ticket or order with a color and icon.
- Filter bars where several statuses can be switched on and off.
- For tiny counters and labels, Badge is more compact.
Examples#
Statuses#
Any CSS color tints the chip; the icon takes the full color and the text a readable shade of it.
QueuedScheduledIn progressHigh PriorityReadyWaitingPausedReviewing
<StatusChip color="#9333ea" icon={<FiClock />}>Queued</StatusChip>
<StatusChip color="#2563eb" icon={<FiCalendar />}>Scheduled</StatusChip>
<StatusChip color="#ea580c" icon={<FiPieChart />}>In progress</StatusChip>
<StatusChip color="#e11d48" icon={<FiZap />}>High Priority</StatusChip>
<StatusChip color="#0d9488" icon={<FiCheckCircle />}>Ready</StatusChip>
<StatusChip color="#c026d3" icon={<FiWatch />}>Waiting</StatusChip>
<StatusChip color="#ca8a04" icon={<FiPauseCircle />}>Paused</StatusChip>
<StatusChip color="#0891b2" icon={<FiSearch />}>Reviewing</StatusChip>Sizes & semantic colors#
ReadyRunningBlocked
<StatusChip size="sm" color="success" icon={<FiCheckCircle />}>Ready</StatusChip>
<StatusChip size="md" color="warning" icon={<FiPlay />}>Running</StatusChip>
<StatusChip size="lg" color="danger" icon={<FiZap />}>Blocked</StatusChip>Toggle filters#
With onClick the chip is a button; selected sets aria-pressed and draws a ring.
Filters: ["progress"]
const [on, setOn] = useState(['progress']);
const toggle = (key) => setOn((v) => (v.includes(key) ? v.filter((k) => k !== key) : [...v, key]));
{statuses.map((s) => (
<StatusChip
key={s.key}
color={s.color}
icon={s.icon}
selected={on.includes(s.key)}
onClick={() => toggle(s.key)}
>
{s.label}
</StatusChip>
))}Used in designs#
StatusChip in real layouts: this design uses it. Open one to try it and copy the code.
API reference#
<StatusChip />
Forwards its ref. Renders a <span>, or a <button> when onClick is given.
| Prop | Type | Default | Description |
|---|---|---|---|
color | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | CSS color | 'primary' | Tint of the chip, icon and text. |
icon | ReactNode | - | Icon before the label. |
size | 'sm' | 'md' | 'lg' | 'md' | Height and font size. |
selected | boolean | - | Toggle state for button chips (aria-pressed + ring). |
onClick | (event) => void | - | Makes the chip a button. |
color'primary''primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | CSS colorTint of the chip, icon and text.
icon-ReactNodeIcon before the label.
size'md''sm' | 'md' | 'lg'Height and font size.
selected-booleanToggle state for button chips (aria-pressed + ring).
onClick-(event) => voidMakes the chip a button.
Accessibility#
- The icon is decorative; the text is the label, so never rely on color alone.
- Toggle chips are real buttons with aria-pressed, so screen readers announce "pressed".
- Text uses a darker shade of the color mixed with the text color, for readable contrast on the tint.