Skip to main content
Modal
@coinbase/cds-web@9.28.0
A component that displays content in a window that requires user interaction.
import { Modal } from '@coinbase/cds-web/overlays/modal/Modal'
Peer dependencies
  • framer-motion: ^10.18.0,
  • react-dom: ^18.0.0 || ~19.1.2

Basic example​

Loading...

Portal Modal​

This approach is deprecated

Use the visible and onRequestClose props as outlined above

Loading...

Chained Modals​

Accessibility tip

For chained modals, set restoreFocusOnUnmount={false} on each one and return focus to the opener when exiting the chain (e.g., triggerRef.current?.focus()) to keep tab order predictable.

Loading...

Scrollable Modal Content​

If the Modal has content which is expected to overflow and doesn't have focusable elements, set the following props to ensure the scrollable content can be navigated using keyboard arrows:

  • focusTabIndexElements: true
  • disableArrowKeyNavigation: true

As well, assign a tabIndex greater than or equal to 0 to the ModalBody so that the overflow can be reached via keyboard.

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.