Custom Theme

Style colors with CSS variables; set layout sizes with customTheme. Use both together when you need full control.

CSS theme

  1. Define CSS variables

    Target .theme-custom with --st-* variables for colors, fonts, and visual styling.
    CSS
    .theme-custom {
    --st-header-background-color: #7c3aed;
    --st-header-label-color: #fff;
    --st-odd-row-background-color: #fffbeb;
    --st-even-row-background-color: #fef3c7;
    --st-hover-row-background-color: #fde68a;
    --st-selected-cell-background-color: #f5f3ff;
    }
  2. Import the stylesheet

    Load your theme CSS in the app (or component) that renders the table.
    React TSX
    import "./my-table-theme.css";
  3. Apply the theme

    Pass theme="custom". Built-in themes are covered on Themes.
    React TSX
    <SimpleTable
    theme="custom"
    columns={columns}
    rows={rows}
    />

Layout dimensions

Use customTheme for heights and widths the virtualizer needs (row height, header height, nested-grid padding, etc.). These cannot be set via CSS alone.

React TSX
<SimpleTable
customTheme={{ rowHeight: 32, headerHeight: 40 }}
columns={columns}
rows={rows}
/>

Example

A table using theme="custom". Code or StackBlitz has the full CSS.

Props

CSS theme

PropertyRequiredDescriptionExample
Optional
Set to "custom" to use your .theme-custom CSS variables.

customTheme

PropertyRequiredDescriptionExample
rowHeight
number
Optional
Height of table rows in pixels. This value is used for virtualization calculations and cannot be styled through CSS. If not specified, uses the default value of 40px.
headerHeight
number
Optional
Height of the table header in pixels. This value is used for virtualization calculations and cannot be styled through CSS. If not specified, uses the default value of 40px.
footerHeight
number
Optional
Height of the table footer in pixels. This value is used for virtualization calculations and cannot be styled through CSS. If not specified, uses the default value of 50px.
rowSeparatorWidth
number
Optional
Width of separators between rows in pixels. This value affects virtualization calculations and cannot be styled through CSS. If not specified, uses the default value of 1px.
borderWidth
number
Optional
General border width in pixels (e.g., table borders, header borders). This value affects layout calculations and cannot be styled through CSS. If not specified, uses the default value of 1px.
pinnedBorderWidth
number
Optional
Width of borders for pinned columns in pixels. This value affects layout calculations for pinned columns and cannot be styled through CSS. If not specified, uses the default value of 2px.
nestedGridBorderWidth
number
Optional
Border width for nested grid tables (top + bottom) in pixels. This value affects nested table layout calculations and cannot be styled through CSS. If not specified, uses the default value of 2px.
nestedGridPaddingTop
number
Optional
Top padding for nested grids in pixels. This value affects nested table layout calculations and cannot be styled through CSS. If not specified, uses the default value of 8px.
nestedGridPaddingBottom
number
Optional
Bottom padding for nested grids in pixels. This value affects nested table layout calculations and cannot be styled through CSS. If not specified, uses the default value of 8px.
nestedGridPaddingLeft
number
Optional
Left padding for nested grids in pixels. This value affects nested table layout calculations and cannot be styled through CSS. If not specified, uses the default value of 16px.
nestedGridPaddingRight
number
Optional
Right padding for nested grids in pixels. This value affects nested table layout calculations and cannot be styled through CSS. If not specified, uses the default value of 16px.
nestedGridMaxHeight
number
Optional
Maximum height for nested grids in pixels. This value controls how tall nested tables can grow before scrolling. If not specified, nested grids will grow to fit their content.
selectionColumnWidth
number
Optional
Width of the row selection checkbox column in pixels. This value affects layout calculations and cannot be styled through CSS. If not specified, uses the default value of 40px.