Name | Type | Required | Default | Description |
---|---|---|---|---|
aria-describedby | string | false | ||
aria-details | string | false | ||
aria-label | string | false | Accessibility notes: `role='dialog'` MUST be labelled. Prefer `aria-labelledby` over `aria-label`. | |
aria-labelledby | string | false | Accessibility notes: `role='dialog'` MUST be labelled. Prefer `aria-labelledby` over `aria-label`. | |
children | ReactNode | false | ||
className | string | false | Additional classNames | |
howToClose | false | [] | This adds additional UI or UX to close. Escape key will always close a dialog, see NOTE 'footer-button': Footer Cancel button still requires at least a rendered self closing NOTE 'x': The X button still requires a rendered | |
id | string | false | Aligns with | |
onClose | ModalOnClose | false | When a user closes the Modal by some approved Accessibility notes: Future default! Moves focus into and cycles focus in the Modal, and returning focus
to the trigger when closed. Also enables the Escape key to close the Modal. | |
open | boolean | false | false | Modal open state |
placement | false | center | Vertical placement of the modal | |
role | "dialog" | false | Enable dialog props. REQUIRES | |
style | CSSProperties | false | Additional CSS styles | |
width | false | Sets a width on the container and uses next centering.
Future will default to | ||
onClickOverlay | Function | false | Callback for clicking the overlay |
A Modal has one requried way to close.
A Modal has many optional ways to close:
Alternatively, you can use Modal howToClose={['x', 'scrim', 'footer-button']} to start to unify all the UI piece event handlers into one location.
Legacy: onClose scattered around.
Next: onClose only, and required, on Modal. See role=dialog.
For the next generation Modal:
Change the width of the Modal.
If you are or were setting width properties on Modal, Modal.Body, or other subcomponents, look to use just width. Using this prop opts into the next gen layout and removes the max-width from Modal.Body. Eventually this layout improvement will always be used.
Name | Type | Required | Default | Description |
---|---|---|---|---|
qa | { closeButton?: string } | false | ||
onClose | Function | false |
Note: howToClose with x, it is still required to render a Modal.Header.
A component that inserts the correct HTML semantic heading level, based on parent (Header, Body, Section, nested Section).
Name | Type | Required | Default | Description |
---|---|---|---|---|
noSideSpacing | boolean | false | false | Removes left, right paddings from the modal body when true |
Name | Type | Required | Default | Description |
---|---|---|---|---|
children | ReactNode | false | ||
className | string | false | Additional classNames | |
style | CSSProperties | false | Additional CSS styles |
Name | Type | Required | Default | Description |
---|---|---|---|---|
children | ReactNode | false | ||
className | string | false | Additional classNames | |
style | CSSProperties | false | Additional CSS styles |
Currently using a Footer Summary requires a max width set on the footer or modal.
Name | Type | Required | Default | Description |
---|---|---|---|---|
children | ReactNode | false | ||
className | string | false | Additional classNames | |
style | CSSProperties | false | Additional CSS styles |
Name | Type | Required | Default | Description |
---|---|---|---|---|
children | ReactNode | false | ||
className | string | false | Additional classNames | |
style | CSSProperties | false | Additional CSS styles |
Note: howToClose with footer-button, it is still required to render a Modal.FooterButtons.
Use howToClose to enable "Cancel" in footer. It is still required to place a self closed Modal.FooterButtons component when using howToClose={['footer-button']}.
Name | Type | Required | Default | Description |
---|---|---|---|---|
aria-describedby | string | false | ||
aria-details | string | false | ||
aria-label | string | false | Accessibility notes: `role='dialog'` MUST be labelled. Prefer `aria-labelledby` over `aria-label`. | |
aria-labelledby | string | false | Accessibility notes: `role='dialog'` MUST be labelled. Prefer `aria-labelledby` over `aria-label`. | |
children | ReactNode | false | ||
className | string | false | Additional classNames | |
headline | string | false | Headline message | |
howToClose | false | [] | This adds additional UI or UX to close. Escape key will always close a dialog, see NOTE 'footer-button': Footer Cancel button still requires at least a rendered self closing NOTE 'x': The X button still requires a rendered | |
id | string | false | Aligns with | |
open | boolean | false | false | Modal open state |
placement | false | center | Vertical placement of the modal | |
role | "dialog" | false | Enable dialog props. REQUIRES | |
style | CSSProperties | false | Additional CSS styles | |
width | false | Sets a width on the container and uses next centering.
Future will default to | ||
onClickOverlay | Function | false | Callback for clicking the overlay | |
onClose | Function | false | The dismiss onClick callback |
Review Tearsheet docs to learn how Modal can work in tandem with Form enableConfirmNavigation when trying to close with unsaved data.
role='dialog'
MUST be labelled. Preferaria-labelledby
overaria-label
.11.12.0