Skip to main content
SegmentedTabs
@coinbase/cds-web@8.56.1
Switches between different views of content.
import { SegmentedTabs } from '@coinbase/cds-web/tabs/SegmentedTabs'
Peer dependencies
  • framer-motion: ^10.18.0
Related components

SegmentedTabs is a controlled component that uses activeTab and onChange to manage selection state.

Basics

Initial Value

You can set any tab as the initial active tab by passing it to the activeTab state.

Loading...

SegmentedTabs can also start with no active selection by passing null.

Loading...

Disabled

The entire component can be disabled with the disabled prop.

Loading...

Individual tabs can also be disabled while keeping others interactive.

Loading...

Styling

Border Radius

Set borderRadius to change the shape of both the container and the active indicator.

Loading...

Use the styles prop to set a different borderRadius on the active indicator than the outer container, with padding to create an inset effect.

Loading...

Labels

Labels can be customized with any ReactNode, including instances of Icon.

Loading...

Custom Components

Use TabComponent and TabsActiveIndicatorComponent to fully customize the tabs and active indicator. Individual tabs can also be customized by providing a Component in the tab definition.

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.