Modal
Modals are a special type of overlay that shift focus towards a specific action/set of information before the main flow can proceed. They must be specified inside the overlay
prop of an activator component (Button
, Link
or Pressable
).
The library automatically applies the WAI-ARIA Dialog pattern to both the activator and the modal content.
Anchor to modalpropsModalProps
A label to describe the purpose of the modal that is announced by screen readers. If not set, it will use the value of title
.
A unique identifier for the Modal. When no id
is set, a globally unique value will be used instead.
Callback when the modal is closed. That is when either the close button, the backdrop, or the escape
key are pressed.
Callback when the modal is opened. This is called at the beginning of the transition that opens the modal.
Adds a default spacing around both header (which holds the title
) and content of the modal.
The primary action to perform, provided as a Button
component. The property allows only one button to be rendered.
The secondary action to perform, provided as a Button
component. The property allows only one button to be rendered.
Adjust the size of the Modal.
max
: expands the Modal to its maximum size, on both the horizontal and vertical axes.
A title rendered at the top of the modal.
Basic Modal
Preview

Anchor to best-practicesBest Practices
Use modals if:
The information needed to be shown is not critical in completing the checkout process and information cannot be condensed into one sentence.
The information the buyer is entering requires less than two rows of input fields.
The information the buyer is entering is not reliant on information on the page (which is underneath the modal and not visible to them).