Modal
A dialog overlay that appears on top of the page content.
Playground
Props
| Prop | Type | Default | Value |
|---|---|---|---|
open | boolean | β | |
onOpenChange | (open: boolean) => void | β | β |
Related Components
ModalTriggerDialogTriggerModalClose
Usage
<Modal>
<ModalTrigger asChild>
<Button>Open Modal</Button>
</ModalTrigger>
<ModalContent>
<ModalHeader>
<ModalTitle>Modal Title</ModalTitle>
<ModalDescription>Modal description text.</ModalDescription>
</ModalHeader>
<p>Modal body content goes here.</p>
<ModalFooter>
<ModalClose asChild>
<Button variant="outline">Cancel</Button>
</ModalClose>
<Button>Confirm</Button>
</ModalFooter>
</ModalContent>
</Modal>