Calendar

A date field component that enables users to choose and edit a date.

Loading...

Installation

npx shadcn@latest add @scrollxui/calendar 

Usage

import { Calendar } from '@/components/ui/calendar';
const [date, setDate] = React.useState<Date | undefined>(new Date());
 
return (
  <Calendar
    mode='single'
    selected={date}
    onSelect={setDate}
    className='rounded-lg border'
  />
);

Examples


YearOrder

Loading...

Disabled Days

Loading...

Single month with range selection

Loading...

Multiple month with range selection

Loading...

Multiple months

Loading...

Date Of Birth Picker

Loading...

Month and Year Selector

Loading...

Date & Time Picker

Loading...

API Reference

Calendar

A date field component that enables users to choose and edit a date.

Props

PropertyTypeDefaultDescription
mode"single" | "multiple" | "range""single"
Selection mode
selectedDate | Date[] | {from: Date; to?: Date}-
Selected date(s) or range
onSelectfunction-
Called on date select
numberOfMonthsnumber1
Months displayed
defaultMonthDatenew Date()
Initial month shown
showWeekNumberboolean
Show week numbers
weekStartsOn0 | 1 | ... | 6
Week start day
captionLayout"label" | "dropdown" | "dropdown-months" | "dropdown-years""label"
Month/year caption style
fromYearnumbercurrentYear-100
Start year for dropdown
toYearnumbercurrentYear
End year for dropdown
disabledDate[] | function | object-
Disable dates
componentsobject-
Custom subcomponents
modifiersobject-
Custom day modifiers
animateboolean
Enable animation
footerReactNode-
Footer content

Built withby Ahdeetai.