calendar
9ui/calendarFreeComponent
9ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by 9ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://9ui.dev/r/calendar.jsonSource
1"use client"23import * as React from "react"4import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react"5import { DayPicker } from "react-day-picker"67import { buttonVariants } from "@/components/ui/button"89import { cn } from "@/lib/utils"1011function Calendar({12 classNames,13 ...props14}: React.ComponentProps<typeof DayPicker>) {15 return (16 <DayPicker17 classNames={{18 root: cn(19 "relative size-fit select-none rounded-md border p-3 shadow-xs",20 props.className21 ),22 month: cn("m-0 space-y-1 text-center", classNames?.month),23 month_caption: cn(24 "flex h-8 items-center justify-center text-sm font-medium",25 classNames?.month_caption26 ),27 today: cn("bg-accent", classNames?.today),28 week: cn("flex justify-center py-0.5", classNames?.week),29 day: cn(30 "flex size-8 items-center justify-center rounded-md text-sm font-normal hover:[&:has(>button)]:bg-accent hover:[&:has(>button)]:text-accent-foreground",31 classNames?.day32 ),33 day_button: cn(34 "size-8 rounded-md focus:outline-hidden focus-visible:outline-[3px] focus-visible:outline-offset-1",35 classNames?.day_button36 ),37 weekdays: cn("flex justify-center", classNames?.weekdays),38 weekday: cn(39 "size-8 text-sm font-normal text-muted-foreground",40 classNames?.weekday41 ),42 outside: cn(43 "text-muted-foreground/80 hover:text-muted-foreground/80!",44 classNames?.outside45 ),46 selected: cn(47 "bg-primary! text-primary-foreground! hover:text-primary-foreground!",48 classNames?.selected49 ),50 range_middle: cn(51 "bg-secondary! text-secondary-foreground! rounded-none first:rounded-l-md last:rounded-r-md hover:bg-secondary! hover:text-secondary-foreground!",52 classNames?.range_middle53 ),54 range_start: cn(55 props.mode === "range" &&56 props.selected?.from?.getTime() !== props.selected?.to?.getTime()57 ? "not-last:rounded-r-none bg-secondary! [&>button]:bg-primary!"58 : "",59 classNames?.range_start60 ),61 range_end: cn(62 props.mode === "range" &&63 props.selected?.from?.getTime() !== props.selected?.to?.getTime()64 ? "not-first:rounded-l-none bg-secondary! [&>button]:bg-primary!"65 : "",66 classNames?.range_end67 ),68 disabled: cn(69 "pointer-events-none text-muted-foreground opacity-50",70 classNames?.disabled71 ),72 hidden: cn("pointer-events-none", classNames?.hidden),73 nav: cn("", classNames?.nav),74// … truncated
What it pulls in
npm packages
Files it writes
More from 9ui
All 56 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | 9ui | Components | Free | no deps | |
| alertalert | 9ui | Components | Free | no deps | |
| alert-dialogalert-dialog | 9ui | Components | Free | no deps | |
| aspect-ratioaspect-ratio | 9ui | Components | Free | no deps | |
| autocompleteautocomplete | 9ui | Components | Free | no deps | |
| avataravatar | 9ui | Components | Free | no deps | |
| badgebadge | 9ui | Components | Free | no deps | |
| breadcrumbsbreadcrumbs | 9ui | Components | Free | no deps |
