mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-02-08 18:39:31 +08:00
70 lines
2.1 KiB
TypeScript
70 lines
2.1 KiB
TypeScript
"use client"
|
|
|
|
import { Settings2 } from "lucide-react"
|
|
|
|
import { Button } from "@/components/ui/button"
|
|
import { Input } from "@/components/ui/input"
|
|
import { Label } from "@/components/ui/label"
|
|
import {
|
|
Popover,
|
|
PopoverContent,
|
|
PopoverTrigger,
|
|
} from "@/components/ui/popover"
|
|
|
|
export function PopoverDemo() {
|
|
return (
|
|
<Popover>
|
|
<PopoverTrigger asChild>
|
|
<Button variant="outline" className="w-10 rounded-full p-0">
|
|
<Settings2 className="h-4 w-4" />
|
|
<span className="sr-only">Open popover</span>
|
|
</Button>
|
|
</PopoverTrigger>
|
|
<PopoverContent className="w-80">
|
|
<div className="grid gap-4">
|
|
<div className="space-y-2">
|
|
<h4 className="font-medium leading-none">Dimensions</h4>
|
|
<p className="text-sm text-slate-500 dark:text-slate-400">
|
|
Set the dimensions for the layer.
|
|
</p>
|
|
</div>
|
|
<div className="grid gap-2">
|
|
<div className="grid grid-cols-3 items-center gap-4">
|
|
<Label htmlFor="width">Width</Label>
|
|
<Input
|
|
id="width"
|
|
defaultValue="100%"
|
|
className="col-span-2 h-8"
|
|
/>
|
|
</div>
|
|
<div className="grid grid-cols-3 items-center gap-4">
|
|
<Label htmlFor="maxWidth">Max. width</Label>
|
|
<Input
|
|
id="maxWidth"
|
|
defaultValue="300px"
|
|
className="col-span-2 h-8"
|
|
/>
|
|
</div>
|
|
<div className="grid grid-cols-3 items-center gap-4">
|
|
<Label htmlFor="height">Height</Label>
|
|
<Input
|
|
id="height"
|
|
defaultValue="25px"
|
|
className="col-span-2 h-8"
|
|
/>
|
|
</div>
|
|
<div className="grid grid-cols-3 items-center gap-4">
|
|
<Label htmlFor="maxHeight">Max. height</Label>
|
|
<Input
|
|
id="maxHeight"
|
|
defaultValue="none"
|
|
className="col-span-2 h-8"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</PopoverContent>
|
|
</Popover>
|
|
)
|
|
}
|