Components · Data Display
Stage Counter
AlphaAdded v11.3.0
A row of selectable stat cards, each with a count and a failed count, that filters a list.
import { StageCounter } from '@nexub/react';Usage
Use it for
Counts per stage above a list of jobs, imports or orders, where pressing a stage filters the list.
Use something else for
Counts that do not filter anything: use StatCard.
Switching between views: use Tabs or SegmentedControl.
Playground
Props
- Import #101 · Queued
- Import #102 · Processing
- Import #103 · In review
- Import #104 · Done
- Import #105 · Queued
<StageCounter aria-label="Filter imports by stage" stages={stages} value={stage} onValueChange={setStage} />Examples
Filters a list
Several stages
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| stagesrequired | StageCounterStage[] | — | { value, label, count, failed?, tone? }. failed shows "3 failed" in the danger tone; tone colours the count. |
| value | string | string[] | — | The selected stage, null for all. Pressing the selected stage again clears it. |
| defaultValue | string | string[] | — | The selected stage, null for all. Pressing the selected stage again clears it. |
| onValueChange | ((value: string) => void) | ((value: string[]) => void) | — | Called with the new stage, or null. |
| multiple | boolean | — | Several stages at once: value is a string[], an empty array means all. |
| aria-label | string | — | Names the group, e.g. "Filter by stage". |
Accessibility
ARIA roles
`group` named by `aria-label`; each card is a toggle `button` with `aria-pressed`.
Keyboard
- Tab
Moves between the stages.
- Enter / Space
Selects or clears the stage.
Notes
The failed count is written out ("3 failed"), not shown by colour alone. Cards wrap on small screens.
On iOS & Android
Web only
Stage Counter has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.