Skip to main content
PeriodSelector
@coinbase/cds-web@9.28.0
A selector component for choosing time periods in charts.
import { PeriodSelector } from '@coinbase/cds-web/visualizations/chart'
Peer dependencies
  • framer-motion: ^10.18.0
Related components

PeriodSelector is a specialized SegmentedTabs optimized for chart time-period selection. It provides a transparent background, primary wash active state, and full-width layout by default.

Basics​

Loading...

Sizing​

Set width to fit-content to make the selector only as wide as its content, and use gap to control spacing between tabs.

Loading...

Live Indicator​

Use the LiveTabLabel component (exported from PeriodSelector) to indicate a live data period. Pair it with a conditional activeBackground to visually differentiate the live state.

Loading...

Overflow​

When there are too many tabs to fit in a single row, wrap the selector in a scrollable container with a fade edge and an optional action button.

Loading...

Customization​

Custom Colors​

Use the activeBackground prop to change the active indicator color. This example conditionally applies a negative wash when the live period is selected.

Loading...

Color Shifting​

Animate the active tab's foreground color using a CSS variable and framer-motion. This pattern is useful for charts where the color changes based on price movement (positive/negative).

Loading...

Asset Price Chart​

A composed example using PeriodSelector to control the time period of a LineChart, with a settings tray for axis toggles.

Loading...

Is this page useful?

Coinbase Design is an open-source, adaptable system of guidelines, components, and tools that aid the best practices of user interface design for crypto products.