A Modal is window containing contextual information, tasks, or workflows that appear over the user interface. The content behind a modal dialog is inert, meaning that users cannot interact with it.
View source codeboolean
Whether the modal should be open
string
The title of the Modal
ReactNode
Actions to display in the Modal
ReactNode
The content of the Modal
string
className for the element
"adjustments-horizontal" | "archive" | "arrow-down-tray" | "arrow-down" | "arrow-left-right" | "arrow-left" | "arrow-merge" | "arrow-path" | "arrow-pointing-out" | "arrow-right-rectangle" | "arrow-right" | "arrow-split" | "arrow-top-right-square" | "arrow-turn-right" | "arrow-up-tray" | "arrow-up" | ... 143 more ...
The icon to display in the button
"alert" | "apricot" | "blue" | "carbon" | "emerald" | "forest" | "grolive" | "info" | "lemon" | "neutral" | "ocean" | "peach" | "pink" | "purple" | "success" | "warning"
Specifies the icon variant
Default: infoReactNode
The illustration to display on top of the Modal
string
Specifies the illustration height
Default: 424pxboolean
Whether the modal should have opening and closing animation
Default: falseMouseEventHandler<HTMLButtonElement>
Handler that is called when the Modal is closed
Element
The element where to mount the Modal. It needs to be outside the GrapesProvider tree for the focus trap to work properly.
Default: document.bodystring
The subtitle of the Modal
boolean
Whether the modal should be open
ReactNode
The content of the ModalOverlay
string
className for the element
boolean
Whether the modal should have opening and closing animation
Default: falseElement
The element where to mount the Modal. It needs to be outside the GrapesProvider tree for the focus trap to work properly.
Default: document.bodynumber
Time to wait before removing the element on exit. Used only when onAnimationEnd is not supported
Default: 200ReactNode
The content of the Modal
string
className for the element
MouseEventHandler<HTMLButtonElement>
Handler that is called when the Modal is closed. If not provided, the Close button won't be displayed
"adjustments-horizontal" | "archive" | "arrow-down-tray" | "arrow-down" | "arrow-left-right" | "arrow-left" | "arrow-merge" | "arrow-path" | "arrow-pointing-out" | "arrow-right-rectangle" | "arrow-right" | "arrow-split" | "arrow-top-right-square" | "arrow-turn-right" | "arrow-up-tray" | "arrow-up" | ... 143 more ...
The icon to display
string
The title of the Modal
"alert" | "apricot" | "blue" | "carbon" | "emerald" | "forest" | "grolive" | "info" | "lemon" | "neutral" | "ocean" | "peach" | "pink" | "purple" | "success" | "warning"
Specifies the icon variant
Default: infostring
The Subtitle of the Modal
string
The title's unique identifier. Same identifier should be pass to ModalContent using aria-labelledby.
ReactNode
The illustration to display
string
The title of the Modal
string
Specifies the illustration height.
Default: 424pxstring
The Subtitle of the Modal
string
The title's unique identifier. Same identifier should be pass to ModalContent using aria-labelledby.
ReactNode
The modal's main content.
string
className for the element
ReactNode
The modal actions