Skip to content

Components

Data and status

Components that show records, status and figures.

Components
Table, bulk action bar, filter chips, record diff, status, severity, tag, avatar, SLA timer, count, stat, card, chart, meter, timeline, key-value list, edit in place, empty state, provenance, log viewer

Data table and grid

A plain <table>. Add data-sg-grid for a keyboard grid with selection and sorting.

Table variants and rules
VariantUse for
Static tableReports and print. No JavaScript.
data-sg-gridWork queues. See Keyboard.
data-selectableSelecting rows for bulk actions.
sg-table--two-lineA subject with metadata under it.
sg-table__expandDetail that opens under a row.
data-sg-columnsA column chooser.
data-resizableResizable columns.
sg-table--pin-firstA fixed first column.
Dense, standard, relaxeddata-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-label naming 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:

Data grid keyboard model
KeysAction
TabEnter at the last active cell; press again to leave.
Arrow keysMove one cell.
Home EndFirst or last cell in the row; with Ctrl, in the grid.
Page Up Page DownMove ten rows.
SpaceToggle row selection.
Shift + Up DownExtend the selection.
Ctrl ASelect all visible rows.
EnterOpen the record. On a header, sort. On a link or button, activate.
Alt + Left RightOn 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:chipremove and the chip's data-value to 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-start or data-risk to set when "at risk" begins (default: the last quarter).
  • data-announce only 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__media for 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.

Choosing a form for the data
The data isUse
One current valueStat, optional sparkline
Magnitude across categoriesBar or horizontal bar; one hue, or emphasis
A trend over timeLine; area for one series
Many samples over timeTime series
Stages in orderHorizontal bar, ordinal ramp
Up to four parts of a wholeDonut or pie, values shown
One value against a range or targetGauge, or a meter when space is tight
How values spreadHistogram
Two categories crossedHeatmap in one hue
More than about seven classesA table, alone or beside the chart

Avoid dual axes, rainbow scales, and color by value on nominal categories.

Live charts

Sparkline:Sequential scale:

Mark specs

Chart mark specifications
MarkSpec
Bar24px thick at most, 2px rounded end, 2px gaps
Line2px; 8px end dot with a 2px surface ring
Slice2px gaps; four parts and "Other" at most; values in the legend
Gauge12px half-circle track, one fill, an ink tick for the target
Heat cell2px gaps; seven steps of one hue
Grid and axisSolid 1px hairlines
LabelsText colors only; the peak and the last value
LegendFor two or more series
ReadoutA card beside the mark, on hover and arrow keys; never the only copy of a value
Series capFour 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.

Component tokens