Calendar
A date picker calendar built on react-day-picker.
calendar-demo.app
Installation
terminal.sh
npx y2kui@latest add calendarUsage
"use client"
import { Calendar } from "@/components/ui/calendar"
import { useState } from "react"
export function Example() {
const [date, setDate] = useState<Date | undefined>(new Date())
return <Calendar selected={date} onSelect={setDate} mode="single" />
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
mode | 'single' | 'multiple' | 'range' | 'single' | Selection mode. |
selected | Date | Date[] | DateRange | — | Currently selected date(s). |
onSelect | function | — | Called when a date is selected. |
showOutsideDays | boolean | true | Show days from adjacent months. |