{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "date-picker-with-presets", "type": "registry:example", "author": "shadcn (https://ui.shadcn.com)", "dependencies": [ "date-fns" ], "registryDependencies": [ "button", "calendar", "popover", "select" ], "files": [ { "path": "examples/date-picker-with-presets.tsx", "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { addDays, format } from \"date-fns\"\nimport { CalendarIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/registry/new-york/ui/button\"\nimport { Calendar } from \"@/registry/new-york/ui/calendar\"\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@/registry/new-york/ui/popover\"\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/registry/new-york/ui/select\"\n\nexport default function DatePickerWithPresets() {\n const [date, setDate] = React.useState()\n\n return (\n \n \n \n \n {date ? format(date, \"PPP\") : Pick a date}\n \n \n \n \n setDate(addDays(new Date(), parseInt(value)))\n }\n >\n \n \n \n \n Today\n Tomorrow\n In 3 days\n In a week\n \n \n
\n \n
\n \n
\n )\n}\n", "type": "registry:example", "target": "" } ] }