mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-01 00:24:20 +00:00
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { Button } from "@/examples/base/ui/button"
|
|
import {
|
|
Dialog,
|
|
DialogClose,
|
|
DialogContent,
|
|
DialogDescription,
|
|
DialogFooter,
|
|
DialogHeader,
|
|
DialogTitle,
|
|
DialogTrigger,
|
|
} from "@/examples/base/ui/dialog"
|
|
import { Input } from "@/examples/base/ui/input"
|
|
import { Label } from "@/examples/base/ui/label"
|
|
|
|
export function DialogCloseButton() {
|
|
return (
|
|
<Dialog>
|
|
<DialogTrigger render={<Button variant="outline" />}>Share</DialogTrigger>
|
|
<DialogContent className="sm:max-w-md">
|
|
<DialogHeader>
|
|
<DialogTitle>Share link</DialogTitle>
|
|
<DialogDescription>
|
|
Anyone who has this link will be able to view this.
|
|
</DialogDescription>
|
|
</DialogHeader>
|
|
<div className="flex items-center gap-2">
|
|
<div className="grid flex-1 gap-2">
|
|
<Label htmlFor="link" className="sr-only">
|
|
Link
|
|
</Label>
|
|
<Input
|
|
id="link"
|
|
defaultValue="https://ui.shadcn.com/docs/installation"
|
|
readOnly
|
|
/>
|
|
</div>
|
|
</div>
|
|
<DialogFooter className="sm:justify-start">
|
|
<DialogClose render={<Button type="button" variant="secondary" />}>
|
|
Close
|
|
</DialogClose>
|
|
</DialogFooter>
|
|
</DialogContent>
|
|
</Dialog>
|
|
)
|
|
}
|