Period tabs

Range selector tabs (1D / 5D / 1M / 1Y / ALL) — companion to ChartNavigator. Pure controlled component.

Primitive: ChartPeriodTabs

Interactive demo

Usage

import { ChartPeriodTabs } from '@ramtt/charts'

<ChartPeriodTabs
  periods={['1M', '3M', '6M', '1Y', 'ALL']}
  selected="1Y"
  onChange={setPeriod}
/>

Props

PropTypeDefaultDescription
periods*string[]Period labels in display order
selected*stringCurrently selected period
onChange*(period: string) => voidCalled when a tab is clicked
classNamestringAdditional Tailwind classes