OptionalcolorSets the CSS color-scheme property on the container (not a --dtbl-* variable).
'light dark' makes light-dark(...) color values (as used by the auto* presets)
follow the browser's light/dark preference; 'light'/'dark' also render matching
scrollbars inside the scrollable wrapper. Note: applyTheme targets <html> by
default, where color-scheme: dark affects the whole page's form controls and
default canvas — theme a subtree or table instead if that's unwanted.
OptionalheaderBackground of the sticky header cells (--dtbl-header-bg; default: inherit, i.e. the row background, which the header row must repaint to cover scrolled data rows).
OptionalhoverBackground of hovered selected rows (--dtbl-hover-selected-bg).
OptionalhoverBackground of hovered unselected rows (--dtbl-hover-unselected-bg).
OptionalparentBackground of rows whose (grand)parent row is selected, when the
highlightChildrenOfSelectedParents item prop is enabled (--dtbl-parent-selected-bg).
OptionalresizeCSS cursor shown over the column-resize drag handle (--dtbl-resize-cursor).
Can be a url(...) x y, fallback value; defaults to defaultResizeCursor.
OptionalrowBackground of data rows and list items (--dtbl-row-bg).
OptionalrowBottom border of all cells, as a full CSS border value (--dtbl-row-border).
OptionalselectedBackground of selected rows/items (--dtbl-selected-bg).
OptionaltextText color of rows and items (--dtbl-text; default: inherit from the page).
Theming
The stylesheet
datatable.csscontains all structural styling under stable, prefixed class names (.dtbl-*). Every color/spacing decision in it reads a CSS custom property (--dtbl-*) whose fallback value is the built-in default theme (lightTheme). A theme is a typed bundle of those custom properties, split into two halves that can be mixed and matched freely with an object spread:TableColors: color scheme (backgrounds, borders, text and selection colors)TableMetrics: everything else (cell/item padding, tree indent, resize cursor)TableThemeis simplyTableColors & TableMetrics, so any combination such as{ ...darkColors, ...compactMetrics }is a complete theme.Applying a theme sets the variables on the component's outer element (never on
:root), so tables with different themes can coexist on one page.Ways to apply a theme:
App-wide/subtree default:
<TableConfig theme={darkTheme}>...</TableConfig>Whole page, including portals and
*Corecomponents:applyTheme(darkTheme)Per table:
<DataTable theme={myTheme} .../>(overrides theTableConfigtheme)Stylesheet-based: pass a string; it is added as a class to the outer element, and your stylesheet defines the
--dtbl-*variables under that class, e.g.When using
DataTableCore/TreeListCore/ListCore(which render no outer element), apply the theme to your own container:<table {...themeProps(myTheme)}>.