Radiant Charts supports light, dark, and system themes out of the box. The theme drives background colour, axis stroke, gridline opacity, label colour, and the default series palette. Every visual property can be further overridden via the options object.
The chart theme is controlled by a single theme string at the top level of RadiantChartOptions. Three values are accepted:
"light" — white canvas, slate axes (default)"dark" — near-black canvas, muted axes"system" — follows the OS dark-mode preference<RadiantChart
options={{
data,
series: [{ type: 'bar', xKey: 'month', yKey: 'revenue' }],
theme: 'dark', // 'light' | 'dark' | 'system'
}}
/><Chart data={data} theme="dark">
<Bar xKey="month" yKey="revenue" />
</Chart>When theme: "system" is set, the ThemeManager subscribes to window.matchMedia('(prefers-color-scheme: dark)'). The chart re-renders automatically when the OS preference changes — no page reload or React state update required.
next-themes, pass resolvedTheme directly: theme={resolvedTheme as "light" | "dark"}. This keeps the chart in sync with the page theme without needing "system" mode.Override the default series color sequence with the top-level palette option. Colors are applied in order and cycle when there are more series than palette entries.
<RadiantChart
options={{
data,
series: [
{ type: 'line', xKey: 'month', yKey: 'revenue' },
{ type: 'line', xKey: 'month', yKey: 'cost' },
],
palette: ['#f43f5e', '#8b5cf6'],
}}
/>Set explicit fill or stroke on individual series to override the palette for that series only:
series: [
{ type: 'bar', xKey: 'month', yKey: 'revenue', fill: '#6366f1' },
{ type: 'bar', xKey: 'month', yKey: 'cost', fill: '#f43f5e' },
]The following visual properties are derived from the active theme:
| Token | Light | Dark | Notes |
|---|---|---|---|
background | #ffffff | #020617 | Canvas fill color |
axisColor | #94a3b8 | #475569 | Axis line and tick stroke |
gridColor | #f1f5f9 | #1e293b | Background gridline stroke |
labelColor | #64748b | #94a3b8 | Axis tick label text |
titleColor | #0f172a | #f8fafc | Chart title text |
tooltipBg | #ffffff | #1e293b | Tooltip background |
tooltipBorder | #e2e8f0 | #334155 | Tooltip border |