Skip to content

Modal

Props

API reference for Modal. For usage examples, see the React tab.

Modal.Root

NameTypeDefault
children (required)ReactNode
defaultOpenboolean

Whether the overlay is open by default (uncontrolled).

isOpenboolean

Whether the overlay is open by default (controlled).

Modal.CloseButton

NameTypeDefault
childrenChildrenOrFunction<ButtonRenderProps>

The children of the component. A function may be provided to alter the children based on component state.

fullWidthbooleanfalse

Renders the Button in with a fluid width

isDisabledboolean

Whether the button is disabled.

isPendingboolean

Whether the button is in a pending state. This disables press and hover events while retaining the ability to focus, and announces the pending state to screen readers.

size"lg" | "md" | "sm"md

Determines the size of the Button

variant"destructive" | "primary" | "secondary" | "tertiary"secondary

Variant for the button.

Modal.Content

NameTypeDefault
childrenReactNode

The content or child elements nested within this component.

Modal.Dialog

NameTypeDefault
childrenReactNode

The children of the component. A function may be provided to alter the children based on component state.

defaultOpenboolean

Whether the overlay is open by default (uncontrolled).

fullscreenboolean
isCloseButtonHiddenbooleanfalse

Removes the close button from Modal

isDismissablebooleanfalse

Whether to close the modal when the user interacts outside it.

isEnteringboolean

Whether the modal is currently performing an entry animation.

isExitingboolean

Whether the modal is currently performing an exit animation.

isKeyboardDismissDisabledbooleanfalse

Whether pressing the escape key to close the modal should be disabled.

isOpenboolean

Whether the overlay is open by default (controlled).

size"lg" | "md" | "sm" | "xl"
UNSTABLE_deferUntilEnteredboolean

Whether to wait until the entry animation completes before hiding content outside the modal and moving focus into it.

UNSTABLE_overrideFocusboolean

Whether to override the focus() method so it does not scroll the page. This is temporary and will be removed after fully testing all overlays.

Modal.Footer

NameTypeDefault
childrenReactNode

The content or child elements nested within this component.

Modal.Overlay

NameTypeDefault
children (required)ReactNode
defaultOpenboolean

Whether the overlay is open by default (uncontrolled).

isDismissablebooleanfalse

Enables the Modal to be closed by clicking outside of the Modal

isEnteringboolean

Whether the modal is currently performing an entry animation.

isExitingboolean

Whether the modal is currently performing an exit animation.

isKeyboardDismissDisabledbooleanfalse

Whether pressing the escape key to close the modal should be disabled.

isOpenboolean

Whether the overlay is open by default (controlled).

UNSTABLE_deferUntilEnteredboolean

Whether to wait until the entry animation completes before hiding content outside the modal and moving focus into it.

UNSTABLE_overrideFocusboolean

Whether to override the focus() method so it does not scroll the page. This is temporary and will be removed after fully testing all overlays.

Modal.Title

NameTypeDefault
childrenReactNode

The content or child elements nested within this component.

levelnumber3

The heading level.