Calendar
scrollxui/calendarFreeComponent
A date field component that enables users to choose and edit a date.
Live preview
live · rendered by the registry
Rendered by scrollxui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://scrollxui.dev/registry/calendar.jsonSource
1'use client';23import * as React from 'react';4import type { Dispatch, SetStateAction } from 'react';5import {6 ChevronDownIcon,7 ChevronLeftIcon,8 ChevronRightIcon,9} from 'lucide-react';10import { cn } from '@/lib/utils';11import { Button } from '@/components/ui/button';1213interface DateRange {14 from: Date | undefined;15 to?: Date | undefined;16}1718interface Modifiers {19 [key: string]:20 | Date[]21 | ((date: Date) => boolean)22 | { dayOfWeek?: number[]; before?: Date; after?: Date };23}2425interface FormatOptions {26 locale?: string;27 [key: string]: unknown;28}2930interface CalendarBaseProps {31 className?: string;32 classNames?: {33 [key: string]: string;34 };3536 showOutsideDays?: boolean;37 showWeekNumber?: boolean;38 numberOfMonths?: number;39 captionLayout?: 'label' | 'dropdown' | 'dropdown-months' | 'dropdown-years';40 fromYear?: number;41 toYear?: number;42 fromMonth?: Date;43 toMonth?: Date;44 yearOrder?: 'asc' | 'desc';4546 disabled?:47 | Date[]48 | ((date: Date) => boolean)49 | { before?: Date; after?: Date; dayOfWeek?: number[] };5051 modifiers?: Modifiers;52 modifiersClassNames?: { [key: string]: string };5354 locale?: string;55 weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;56 firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7;5758 labels?: {59 labelMonthDropdown?: () => string;60 labelYearDropdown?: () => string;61 labelNext?: () => string;62 labelPrevious?: () => string;63 };6465 formatters?: {66 formatCaption?: (date: Date, options?: FormatOptions) => string;67 formatDay?: (date: Date) => string;68 formatMonthDropdown?: (date: Date) => string;69 formatYearDropdown?: (date: Date) => string;70 formatWeekNumber?: (weekNumber: number) => string;71 formatWeekdayName?: (date: Date) => string;72 };7374 onMonthChange?: (date: Date) => void;75 onDayClick?: (date: Date, modifiers: string[]) => void;76 onDayMouseEnter?: (date: Date, modifiers: string[]) => void;77 onDayMouseLeave?: (date: Date, modifiers: string[]) => void;7879 footer?: React.ReactNode;80 components?: {81 DayButton?: React.ComponentType<CalendarDayButtonProps>;82 [key: string]: React.ComponentType<CalendarDayButtonProps> | undefined;83 };8485 animate?: boolean;86 dir?: 'ltr' | 'rtl';87 autoFocus?: boolean;88 defaultMonth?: Date;8990 ISOWeek?: boolean;91 fixedWeeks?: boolean;9293 buttonVariant?: string;94}9596interface CalendarProps extends CalendarBaseProps {97 mode?: 'single' | 'multiple' | 'range';98 selected?: Date | Date[] | DateRange;99 onSelect?:100// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from scrollxui
All 180 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | scrollxui | Components | Free | 4 deps | |
| Alert Dialogalert-dialog | scrollxui | Components | Free | 7 deps | |
| Animated Buttonanimated-button | scrollxui | Components | Free | 4 deps | |
| Animated Tabsanimated-tabs | scrollxui | Components | Free | 1 dep | |
| Animated Testimonialsanimated-testimonials | scrollxui | Components | Free | 2 deps | |
| Animated TextGenerateanimated-textgenerate | scrollxui | Components | Free | 3 deps | |
| Announcementannouncement | scrollxui | Components | Free | 5 deps | |
| Aspect Ratioaspect-ratio | scrollxui | Components | Free | 1 dep |
