@zendeskgarden/react-modals package provides components for rendering overlay content above the main page. All components require a ThemeProvider at the root of your application.
Installation
Modal
A dialog overlay that traps focus and renders via a portal. UseModal for confirmation dialogs, forms, or any content that requires the user’s attention before continuing.
Modal composes the following subcomponents:
Modal.Header— title area at the top of the modalModal.Body— scrollable content areaModal.Footer— action bar at the bottomModal.FooterItem— wraps individual actions inside the footerModal.Close— accessible close button
Usage
Modal props
Handles close actions triggered from the backdrop or the close button.
Centers the modal vertically and horizontally on the backdrop.
Animates the modal entrance and exit.
Applies a wider layout to the modal.
Passes HTML attributes directly to the backdrop element.
Defines the DOM element the modal portal attaches to. Defaults to
document.body.Directs keyboard focus to the modal when it mounts.
Returns keyboard focus to the element that triggered the modal on close.
Modal.Header props
Applies danger (destructive action) styling to the header.
Overrides the rendered HTML element tag.
Drawer
A panel that slides in from the side of the viewport. UseDrawer for navigation, filters, or supplemental content that coexists with the main page.
Drawer composes the following subcomponents:
Drawer.Header— title areaDrawer.Body— scrollable content areaDrawer.Footer— action bar at the bottomDrawer.FooterItem— wraps individual actions inside the footerDrawer.Close— accessible close button
Usage
Drawer props
Controls whether the drawer is visible.
Handles close actions triggered from the backdrop or the close button.
Passes HTML attributes directly to the backdrop element.
Defines the DOM element the drawer portal attaches to. Defaults to
document.body.Directs keyboard focus to the drawer when it opens.
Returns keyboard focus to the triggering element when the drawer closes.
TooltipDialog
A positioned dialog anchored to a reference element. UseTooltipDialog for contextual help, guided flows, or confirmation prompts attached to a specific UI element.
TooltipDialog composes the following subcomponents:
TooltipDialog.Title— heading at the top of the dialogTooltipDialog.Body— content areaTooltipDialog.Footer— action barTooltipDialog.FooterItem— wraps individual actions inside the footerTooltipDialog.Close— accessible close button
Usage
TooltipDialog props
The element the dialog is anchored to. When
undefined, the dialog is not rendered.Controls the preferred placement of the dialog relative to the reference element. Accepts
'auto', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'end', 'end-top', 'end-bottom', 'start', 'start-top', 'start-bottom'.Adds a directional arrow pointing to the reference element.
A list of fallback placements to use when the preferred placement has insufficient space.
Handles close actions triggered from the backdrop or the close button.
Animates the dialog entrance and exit.
Keeps the dialog content in the DOM when closed instead of unmounting it.
Sets the
z-index of the dialog.Defines the DOM element the dialog portal attaches to. Defaults to
document.body.TooltipDialog.Title props
Overrides the rendered HTML element tag.