Components
Data and status
Components that show records, status and figures.
Data table and grid
A plain <table>. Add data-sg-grid for a keyboard grid with selection and sorting.
| Variant | Use for |
|---|---|
| Static table | Reports and print. No JavaScript. |
data-sg-grid | Work queues. See Keyboard. |
data-selectable | Selecting rows for bulk actions. |
sg-table--two-line | A subject with metadata under it. |
sg-table__expand | Detail that opens under a row. |
data-sg-columns | A column chooser. |
data-resizable | Resizable columns. |
sg-table--pin-first | A fixed first column. |
| Dense, standard, relaxed | data-density on the table or an ancestor. Offer all three past 25 rows. |
Use
- Right-aligned tabular numbers; units in the header.
- Sticky headers when the table scrolls.
- A caption or
aria-labelnaming the table. - Pagination with a stable page size.
Avoid
- Zebra stripes, row hover and vertical rules.
- Tables of one-control rows: use a list.
- Column reordering.
- Header icons other than sort and select.
- Infinite scroll in work queues.
Expandable rows and column controls
For wide queues.
Keyboard
A grid is one tab stop. Inside it:
| Keys | Action |
|---|---|
| Tab | Enter at the last active cell; press again to leave. |
| Arrow keys | Move one cell. |
| Home End | First or last cell in the row; with Ctrl, in the grid. |
| Page Up Page Down | Move ten rows. |
| Space | Toggle row selection. |
| Shift + Up Down | Extend the selection. |
| Ctrl A | Select all visible rows. |
| Enter | Open the record. On a header, sort. On a link or button, activate. |
| Alt + Left Right | On a resizable header, narrow or widen the column. |
| / | Focus the filter from anywhere. Esc clears it. |
Component tokens
Bulk action bar
Selected count and actions, fixed to the bottom of the window.
Use
- Actions named for their result, with the row count.
- A dialog listing the impact before irreversible actions.
Avoid
- A bar above the table.
- More than four actions: put the rest in a menu.
Component tokens
Filter chips
Active filters, above the list. Each chip removes itself; Clear all removes all.
Use
- Field and value: "Status: Open".
data-sg-chips="#id": where focus goes after the last chip.sg:chipremoveand the chip'sdata-valueto update results.
Avoid
- Chips for adding filters.
- Colored chips.
Component tokens
Record diff
Changed fields: the old value struck through, the new one semibold.
Use
- Only changed fields, with a link to the full record.
- "Empty" for a missing value.
- A provenance line: who, when and why.
Avoid
- Green and red for added and removed.
- Character diffs in names and IDs.
Component tokens
Status, severity, tag and avatar
Status says who acts next. Severity is four bars. A tag is a neutral category. An avatar's color means nothing.
Use
- A labeled status wherever a record has a state.
- Small size in list rows and meta lines; large in a record header.
- An accessible name on severity.
- Tags for stable categories.
Avoid
- Coloring a tag or a whole row by status.
- Color on Low or Medium severity.
- An avatar palette.
Component tokens: status and severity
SLA timer
Time left until a reply or resolution is due. Add data-sg-sla and data-due to count down live.
Use
- A label when a ticket has several targets: "First reply".
data-startordata-riskto set when "at risk" begins (default: the last quarter).data-announceonly on the person's own tickets.
Avoid
- Color without the words "left" and "overdue".
- Ticking seconds on every row.
Component tokens
Count
A number beside a label; strong when it needs attention.
Use exact numbers up to 999, then "999+". Avoid red counters.
Component tokens
Stat and hero figure
Label, value, delta and optional trend, in one strip with provenance below.
Use
- Arrow, signed change and period: "Up 6.2% on August".
- Green or red only when you know whether up is good.
- Proportional digits for big values; tabular where numbers stack.
Avoid
- Delta color from direction alone.
- More than one hero, or a hero larger than 48px.
Component tokens
Cards
One item among peers, such as an office or a saved view.
Use
- Peers to browse or compare, such as dashboards.
- The same parts in every card of a grid.
sg-card__mediafor an edge-to-edge image.
Avoid
- Cards for records scanned in bulk: use a table.
- A card per figure: use a stat strip.
- Cards inside panels or other cards.
Component tokens
Charts
Stingray.chart draws accessible SVG with a title, legend, readout, provenance and table view.
| The data is | Use |
|---|---|
| One current value | Stat, optional sparkline |
| Magnitude across categories | Bar or horizontal bar; one hue, or emphasis |
| A trend over time | Line; area for one series |
| Many samples over time | Time series |
| Stages in order | Horizontal bar, ordinal ramp |
| Up to four parts of a whole | Donut or pie, values shown |
| One value against a range or target | Gauge, or a meter when space is tight |
| How values spread | Histogram |
| Two categories crossed | Heatmap in one hue |
| More than about seven classes | A table, alone or beside the chart |
Avoid dual axes, rainbow scales, and color by value on nominal categories.
Live charts
Mark specs
| Mark | Spec |
|---|---|
| Bar | 24px thick at most, 2px rounded end, 2px gaps |
| Line | 2px; 8px end dot with a 2px surface ring |
| Slice | 2px gaps; four parts and "Other" at most; values in the legend |
| Gauge | 12px half-circle track, one fill, an ink tick for the target |
| Heat cell | 2px gaps; seven steps of one hue |
| Grid and axis | Solid 1px hairlines |
| Labels | Text colors only; the peak and the last value |
| Legend | For two or more series |
| Readout | A card beside the mark, on hover and arrow keys; never the only copy of a value |
| Series cap | Four series; three when marks touch. Past it, "Other" or a table (see Color) |
Other chart libraries
Pass type: 'custom' and a render function. Stingray keeps the frame, legend, provenance and table view; colors come from Stingray.chartTheme().
Time series
Drawn by uPlot. Hover to read values, drag to zoom, click a legend row to isolate a series.
Vendor the library. The legend, table view and reduced motion still apply.
Component tokens
Meter
A ratio against a limit, such as SLA time used: neutral, then amber, then red.
Accessibility: role="meter". Announce a state change once, not every tick.
Component tokens
Timeline
A ticket's history, grouped by day, with a filter by event type.
Use
- One sentence per event: who did what.
- Cards only for what someone wrote.
- Newest first for work; oldest first for audits.
Avoid
- A line per automatic change: group changes made together.
- A timeline for process steps: use a stepper.
Component tokens
Key-value list
One record's details, as a description list.
Edit in place
For values that change often. Enter or leaving the field saves; Esc cancels.
Component tokens
Empty state
What is missing and one way forward. No illustration.
Component tokens
Provenance line
Source, as-of time and sample size, under every stat and chart.
Data older than an hour gets a warning banner.
Updating
While fresh data loads, the old figures stay and the line says Updating. Cells that changed carry data-sg-changed and are tinted for a moment.
Component tokens
Log viewer
Job, deploy or device output. It follows new lines only when scrolled to the end.
Use aria-live="off" on a busy log. Avoid a log for records: use a table.