Skip to main content
Tabs
@coinbase/cds-web@8.64.0
Tabs is a flexible, accessible tab list for switching between related views. Use `DefaultTab` and `DefaultTabsActiveIndicator` for a standard underline tab row without wiring custom components, or supply your own `TabComponent` and `TabsActiveIndicatorComponent` for full control. For pill-style selection, see SegmentedTabs.
import { Tabs, DefaultTabsActiveIndicator } from '@coinbase/cds-web/tabs'
Peer dependencies
  • framer-motion: ^10.18.0
Related components

Tabs manages which tab is active and positions the animated indicator. For the common underline pattern, pass TabsActiveIndicatorComponent={DefaultTabsActiveIndicator} and rely on the default TabComponent (DefaultTab). Use a custom TabComponent when you need layout or content beyond what DefaultTab provides. For pill / segmented controls, use SegmentedTabs instead.

Basics

Out of the box, Tabs uses DefaultTab for each row (headline text, optional DotCount via count / max on each tab) and DefaultTabsActiveIndicator for the animated underline. activeBackground sets the underline color (it is forwarded to the indicator as its background token).

Loading...

You can omit TabComponent explicitly: Tabs defaults it to DefaultTab.

No initial selection

Loading...

Dot counts

Optional count and max on each tab are forwarded to the badge next to the label (see DotCount).

Loading...

Disabled

Disable the whole row with disabled, or set disabled: true on individual tab items.

Loading...

Custom TabComponent

Use useTabsContext inside your own tab button.

Loading...

Custom label content

Pass extra fields on each tab and read them in your TabComponent (for example icons).

Loading...

Accessibility

Provide a descriptive accessibilityLabel on Tabs for the tab list. DefaultTab sets aria-controls / aria-selected for each tab; pair tabs with role="tabpanel" regions in your page content when you switch panels.

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.