Dialog overlay built on the native <dialog> element and the modal enhancer, which adds a focus trap, body scroll-lock, and a background inert barrier. Compose with <ModalHeader>, <ModalBody>, and <ModalFooter>. Open state works uncontrolled (defaultOpen, or a command="show-modal" invoker button) or controlled (open + onOpenChange).

<Modal open={open} onOpenChange={setOpen}>
<ModalHeader>Confirm</ModalHeader>
<ModalBody>Are you sure?</ModalBody>
<ModalFooter><Button onClick={() => setOpen(false)}>Close</Button></ModalFooter>
</Modal>

Properties

$$typeof: symbol
displayName?: string

Used in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.

propTypes?: any

Ignored by React.

Only kept in types for backwards compatibility. Will be removed in a future major release.