TradingChart widget

Theming

Chart theme and the --rc-* CSS variables of the widget UI.

Chart theme

theme takes "light", "dark" or a full theme object, applied to every chart of the layout. The theme toggle in the toolbar switches between light and dark (and is saved in the state). This site passes a zinc theme that matches its own colors.

<TradingChart theme={createTheme({ background: "#09090b", up: "#22c55e", down: "#ef4444" }, darkTheme)} />

UI colors

The toolbars, menus and dialogs are plain CSS scoped to .rc-widget and themed with CSS custom properties. The widget sets data-theme="dark" in dark mode. Override any of them:

.rc-widget {
  --rc-accent: #7c3aed;
  --rc-radius: 10px;
  --rc-font: "Inter", sans-serif;
}
.rc-widget[data-theme="dark"] {
  --rc-bg: #09090b;
  --rc-panel: #18181b;
  --rc-border: #27272a;
}
VariableUsed for
--rc-bgWidget and toolbar background
--rc-panelMenus, dialogs, popovers
--rc-borderBorders and separators
--rc-border-strongInput and stronger borders
--rc-textText
--rc-mutedSecondary text and icons
--rc-accentActive buttons, selection, primary buttons
--rc-accent-hoverHovered primary buttons
--rc-accent-textText on accent backgrounds
--rc-hoverHovered buttons and rows
--rc-activePressed / selected buttons
--rc-input-bgInputs and selects
--rc-backdropDialog backdrop
--rc-shadowMenus and dialogs shadow
--rc-starFavorite stars
--rc-up / --rc-downPrice change colors in the UI
--rc-radiusCorner radius
--rc-fontFont family
--rc-toolbar-heightTop toolbar height
--rc-bottombar-heightBottom bar height

The drawing toolbars use the same variable names on .rc-dt, .rc-dst and .rc-zoom-buttons.

On this page