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.
Back Button
Use onBackButtonClick to show a back arrow for multi-step flows. The back button appears on the left side of the header.
Title Only
Omit buttons by not providing onBackButtonClick and setting hideCloseButton on the Modal.
Styling
Spacing
ModalHeader extends Box and supports style props like paddingX and paddingY to customize spacing.
Without Divider
Set hideDividers on Modal to remove the bottom border from the header.
Accessibility
Always provide closeAccessibilityLabel for the close button and backAccessibilityLabel when using the back button. These labels are announced by screen readers.
Composed Examples
Multi-Step Wizard
Use onBackButtonClick to navigate between steps in a wizard flow.