Popover
tsx
import { Button } from "@/components/ui/button";import {Popover,PopoverContent,PopoverDescription,PopoverHeader,PopoverTitle,PopoverTrigger,} from "@/components/ui/popover";const FIELDS = [{ label: "Width", value: "100%" },{ label: "Max. width", value: "300px" },{ label: "Height", value: "25px" },];export function PopoverDemo() {return ( <Popover> <PopoverTrigger asChild> <Button variant="outline">Open popover</Button> </PopoverTrigger> <PopoverContent className="w-80"> <div className="grid gap-4"> <PopoverHeader> <PopoverTitle>Dimensions</PopoverTitle> <PopoverDescription> Set the dimensions for the layer. </PopoverDescription> </PopoverHeader> <div className="grid gap-2"> {FIELDS.map((field) => ( <label key={field.label} className="grid grid-cols-3 items-center gap-4 text-sm" > {field.label} <input className="col-span-2 h-8 rounded-md border border-input bg-transparent px-2" defaultValue={field.value} /> </label> ))} </div> </div> </PopoverContent> </Popover>);}