Dialog
A light gray window over a dimmed world.
Install and use
The first command adds the component and the Mine theme, the second adds this example. Render <Mine> once near your root for the skin, sounds and narrator.
"use client"
import {
Dialog,
DialogBackdrop,
DialogClose,
DialogContent,
DialogDescription,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog"
import { Field, FieldLabel } from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import { XIcon } from "lucide-react"
function Example() {
return (
<Dialog>
<DialogTrigger>Share</DialogTrigger>
<DialogBackdrop />
<DialogContent>
<div data-slot="stack">
<DialogTitle>Share link</DialogTitle>
<DialogDescription>
Anyone who has this link will be able to view this.
</DialogDescription>
</div>
<Field>
<FieldLabel>Link</FieldLabel>
<Input defaultValue="https://example.com/project" readOnly />
</Field>
<div data-slot="row">
<DialogClose data-variant="solid">Done</DialogClose>
</div>
<DialogClose aria-label="Close">
<XIcon aria-hidden="true" />
</DialogClose>
</DialogContent>
</Dialog>
)
}
export { Example }