Calendar
A date field component that allows users to enter and edit date.
Loading...
"use client"
import * as React from "react"Installation
pnpmnpmyarnbun
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"
/>
)Examples
Date Range
You can select a range of dates using the mode="range" prop.
Loading...
"use client"
import * as React from "react"Multiple Months
Display multiple months using the numberOfMonths prop.
Loading...
"use client"
import * as React from "react"With Dropdown Navigation
Use dropdowns to navigate between months and years.
Loading...
"use client"
import * as React from "react"API Reference
Calendar
The Calendar component is built on top of React Day Picker.