Preview

Installation

<> import.ts
import { DatePicker } from "@/components/ui/date-picker"

Code

<> component.tsx
import { DatePicker } from "@/components/ui/date-picker"

<DatePicker />

API Reference

DatePicker

A button-triggered calendar picker with animated dropdown.

<> import.ts
import { DatePicker, DatePickerPresets } from "@/components/ui/date-picker"

Props

PropTypeDefaultDescription
value
DateControlled selected date
onChange
(date: Date) => voidCalled on date select
placeholder
string"Select a date..."Trigger placeholder
className
string""Additional CSS classes
size
"sm" | "md" | "lg""sm"Control trigger sizing
disabled
booleanfalseDisable interactions
minDate
DateMinimum selectable date
maxDate
DateMaximum selectable date
showToday
booleantrueShow Go to Today and today highlight

Examples

Example 1
<> example.tsx
// Basic
<DatePicker />
Example 2
<> example.tsx
// Controlled
<DatePicker value={date} onChange={setDate} />

Presets

small

Small size

medium

Medium size

large

Large size