Skip to content
nexubDesign System
v11.9.0

Components · Data Display

Chart Toggle

BetaAdded v4.6.0

A legend whose entries switch series on and off, wrapped around any chart.

import { ChartToggle } from '@nexub/react';
View as Markdown

Playground

Props

Signups by platform
mWebiOSAndroid
May1208060
Jun1409572
Jul15011090
Aug170128101
TSX
<ChartToggle series={series} className="w-full">…</ChartToggle>

Examples

Toggle series

Signups by platform
mWebiOSAndroid
May1208060
Jun1409572
Jul15011090
Aug170128101

Props

Props
PropTypeDefaultDescription
seriesrequiredChartSeries[]—The same series the chart takes.
childrenrequired(visible: ChartSeries[]) => React.ReactNode—Renders the chart with the series that are on. Colours stay stable.
labelstring'Series'Accessible name for the group of toggles.
classNamestring—

Accessibility

Keyboard

  • Tab / Space

    Move between series and switch one on or off.

Screen reader

  • Each series is a toggle button with `aria-pressed`. The last visible series cannot be switched off.

On iOS & Android