calendar-32
showcase-elevenlabs/calendar-32FreeBlock
Date picker in a drawer
Install it
npx shadcn@latest add https://raw.githubusercontent.com/elevenlabs/showcase/main/apps/www/public/r/styles/new-york/calendar-32.jsonSource
1"use client"23import * as React from "react"4import { CalendarPlusIcon } from "lucide-react"56import { Button } from "@/registry/new-york/ui/button"7import { Calendar } from "@/registry/new-york/ui/calendar"8import {9 Drawer,10 DrawerContent,11 DrawerDescription,12 DrawerHeader,13 DrawerTitle,14 DrawerTrigger,15} from "@/registry/new-york/ui/drawer"16import { Label } from "@/registry/new-york/ui/label"1718export default function Calendar32() {19 const [open, setOpen] = React.useState(false)20 const [date, setDate] = React.useState<Date | undefined>(undefined)2122 return (23 <div className="flex flex-col gap-3">24 <Label htmlFor="date" className="px-1">25 Date of birth26 </Label>27 <Drawer open={open} onOpenChange={setOpen}>28 <DrawerTrigger asChild>29 <Button30 variant="outline"31 id="date"32 className="w-48 justify-between font-normal"33 >34 {date ? date.toLocaleDateString() : "Select date"}35 <CalendarPlusIcon />36 </Button>37 </DrawerTrigger>38 <DrawerContent className="w-auto overflow-hidden p-0">39 <DrawerHeader className="sr-only">40 <DrawerTitle>Select date</DrawerTitle>41 <DrawerDescription>Set your date of birth</DrawerDescription>42 </DrawerHeader>43 <Calendar44 mode="single"45 selected={date}46 captionLayout="dropdown"47 onSelect={(date) => {48 setDate(date)49 setOpen(false)50 }}51 className="mx-auto [--cell-size:clamp(0px,calc(100vw/7.5),52px)]"52 />53 </DrawerContent>54 </Drawer>55 <div className="text-muted-foreground px-1 text-sm">56 This example works best on mobile.57 </div>58 </div>59 )60}
What it pulls in
Other registry items
Files it writes
More from shadcn/ui
All 357 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| calendar-01calendar-01 | shadcn/ui | Blocks | Free | no deps | |
| calendar-02calendar-02 | shadcn/ui | Blocks | Free | no deps | |
| calendar-03calendar-03 | shadcn/ui | Blocks | Free | no deps | |
| calendar-04calendar-04 | shadcn/ui | Blocks | Free | no deps | |
| calendar-05calendar-05 | shadcn/ui | Blocks | Free | no deps | |
| calendar-06calendar-06 | shadcn/ui | Blocks | Free | no deps | |
| calendar-07calendar-07 | shadcn/ui | Blocks | Free | no deps | |
| calendar-08calendar-08 | shadcn/ui | Blocks | Free | no deps |
