Overlays
Dialog
A window over the page, built on the browser’s own <dialog>. Focus stays inside until it closes.
Overlays
A window over the page, built on the browser’s own <dialog>. Focus stays inside until it closes.
Change the props on the right, then open the dialog.
import { Button } from 'omuk-ui/button';
import {
Dialog,
DialogClose,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from 'omuk-ui/dialog';
<Dialog>
<DialogTrigger render={<Button variant="outline" />}>
Open the dialog
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>What’s new in 1.0</DialogTitle>
<DialogDescription>Fields keep their container’s width, and toasts pause while the pointer is over them.</DialogDescription>
</DialogHeader>
<DialogFooter>
<DialogClose render={<Button />}>Got it</DialogClose>
</DialogFooter>
</DialogContent>
</Dialog>The trigger opens it, DialogClose or Escape closes it, and focus goes back to the trigger. render draws the trigger and the close as Buttons.
With open and onOpenChange, the parent decides. For a dialog opened from code and answered with a value, Prompt is shorter.