Modal
A centred dialog over the page, for a short task or a message. Every one needs an accessible name, through `title`, `aria-labelledby` or `aria-label`.
Health
Source
Design
Storybook
Playground
No Example
Accessibility
partially-compliant
Platform
Web
Accessibility issues
The focus is trapped correctly. The modal is missing a labelledby attribute. The first interactive element is not focused when the modal is opened.
- Overview
- Props
- Figma
Modal props
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| aria-label | stringundefined | |||
| aria-labelledby | stringundefined | |||
| decor | ReactNode | |||
| description | ReactNode | |||
| forceHideCloseButton | booleanundefined | false | In some specific cases, the close button can be handled manually by the code using <Modal> as part of it's `children`. In these cases, we want to hide the default close button even if the `onClose` prop is defined. | |
| image | ReactNode | Image to display on the left of the modal. @beta | ||
| isOpen | booleanundefined | false | ||
| onClose | (() => void)undefined | |||
| shouldFocusAfterRender | booleanundefined | true | ||
| styles | 5 possibilities{ overlay?: CSSPropertiesundefined; content?: CSSPropertiesundefined; width?: stringundefined; }undefined | |||
| title | stringundefined |