useTableRowStatus
@astryxdesign/core v0.7.1 · useTableRowStatus
The config is a MaybeRefOrGetter, so pass a getter or a ref to keep the plugin on the current values.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
getStatus | (item: T) => TableRowStatus | null | — | Derive either a semantic outcome or a custom marker. {status, label} accepts the closed success/error/warning vocabulary and resolves its glyph and tone through the active theme. {color, icon?, label} preserves the stable custom-marker path: color always selects paint, no icon renders an 8px dot, and icon renders the explicit caller glyph. Even color values named success/error/warning remain dots without icon. Valid icon names: close, chevronDown, chevronLeft, chevronRight, chevronsLeft, chevronsRight, check, success, error, warning, info, calendar, clock, externalLink, menu, moreHorizontal, search, upload, arrowUp, arrowDown, arrowsUpDown, funnel, eyeSlash, viewColumns, copy, checkDouble, wrench, stop, microphone, image. The branches are exclusive, label is required and announced via role="img", and null leaves the row status cell empty. |
| Field | Type | Description |
|---|---|---|
status | 'success' | 'warning' | 'error' | Semantic outcome. The glyph and the tone come from the theme. Exclusive with color. |
color | 'accent' | 'success' | 'error' | 'warning' | 'red' | 'orange' | 'green' | 'yellow' | 'blue' | 'gray' | (string & {}) | Paint for the marker. Without icon it paints the 8px dot; a raw CSS color is used as given. |
icon | string | One of the icon names above, or an Iconify id with a : in it. Named colors keep their Icon color mapping; a raw CSS color overrides the paint exactly. |
label | string | Accessible name for the marker, also shown as a tooltip on hover. |
Returns
| Field | Type | Description |
|---|---|---|
transformColumns | (columns: TableColumn<T>[]) => TableColumn<T>[] | Prepends the status column. Its key is __rowStatus, its width is pixel(28) and it is not resizable. The header is visually blank and carries the localized name from the message table. |