Skip to main content
Collapsible
@coinbase/cds-web@8.34.1
A container that can be expanded or collapsed.
Import
import { Collapsible } from '@coinbase/cds-web/collapsible/Collapsible'
SourceView source codeStorybookView StorybookFigmaView Figma (internal only)
Peer dependencies
  • framer-motion: ^10.18.0
Related components
View as Markdown

Basic Collapsible

Accessibility tip (web)

In order to ensure Collapsible components are accessible on the web, we need to set up the trigger and Collapsible to reference each other correctly. The useA11yControlledVisibility is ideal for this, but you can also wire up each aria-* attr manually following the aria-expanded spec.

Loading...

Expand Top

Place Collapsible above the trigger to expand top.

Loading...

Scroll Content

Enable scroll by setting maxHeight.

Loading...

Horizontal (Experimental)

Set direction="horizontal" for horizontal expand/collapse.

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.