Docs
Calendar

Calendar

A calendar component lets users select a date without any input or popper / modal.

February 2025
SuMoTuWeThFrSa

About

The <Calendar /> component is built on top of React DayPicker.

Installation

pnpm dlx cross-env REGISTRY_URL=https://ui-x.junwen-k.dev/r pnpm dlx shadcn@latest add 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-md border"
  />
)

See the React DayPicker documentation for more information.

Date Picker

For a complete Date Picker component with date input functionality, you can use the <DatePicker> component directly. See the Date Picker page for more information.

Examples

Multiple

February 2025
SuMoTuWeThFrSa
March 2025
SuMoTuWeThFrSa
SuMoTuWeThFrSa

Form

February 2025
SuMoTuWeThFrSa

Your date of birth is used to calculate your age.