Skip to main content
ModalHeader
@coinbase/cds-web@9.28.0
A component that provides a consistent header section for Modal.
import { ModalHeader } from '@coinbase/cds-web/overlays/modal/ModalHeader'
Related components

ModalHeader provides a consistent header section for Modal. It displays a centered title with optional back and close buttons that integrate with Modal's context.

Basics​

Pass a title to display centered text. The close button automatically appears and uses Modal's onRequestClose handler.

Loading...

Back Button​

Use onBackButtonClick to show a back arrow for multi-step flows. The back button appears on the left side of the header.

Loading...

Title Only​

Omit buttons by not providing onBackButtonClick and setting hideCloseButton on the Modal.

Loading...

Styling​

Spacing​

ModalHeader extends Box and supports style props like paddingX and paddingY to customize spacing.

Loading...

Without Divider​

Set hideDividers on Modal to remove the bottom border from the header.

Loading...

Accessibility​

Always provide closeAccessibilityLabel for the close button and backAccessibilityLabel when using the back button. These labels are announced by screen readers.

Loading...

Composed Examples​

Multi-Step Wizard​

Use onBackButtonClick to navigate between steps in a wizard flow.

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.