Skip to content
LoidoltTheme 0.11.1
Svelte 5

Component

ChartDataTable

A chart’s data as a table — the non-visual alternative every chart carries.

import { ChartDataTable } from '@loidolt/theme-charts';

Example

Sheets cut, first quarter
MonthBirch plyCorkAcrylic
Jan421812
Feb482210
Mar512014

Notes

  • Each chart’s …Table() helper in @loidolt/theme-charts/core builds the rows. First cells are row headers; numbers are right-aligned and formatted with valueFormat.
  • visuallyHidden keeps it for assistive tech only, as a plain table rather than a scroll region, so no invisible tab stop is left for keyboard users.

Props

Generated from the component source, so it cannot drift from the implementation.

ChartDataTable props
PropTypeDefaultNotes
caption required string—Names the table, usually the chart's title.
table required ChartTable—The rows and columns, as the chart builders' …Table() helpers return them.
class string—
emptyCell string'—'Written in empty cells.
ref bindableHTMLDivElement | nullnull
valueFormat FormatOptions—How numbers are written.
visuallyHidden booleanfalsePresent the table to assistive tech only. A chart's default: the picture is for the eye, the table for everyone else, and neither gets in the other's way.

Plus the attributes of HTMLAttributes<HTMLDivElement>, forwarded to the root element.