Installation
npx shadcn@latest add @iconiq/calendarProps
Calendar
shadcn-style animated monthly calendar with controlled/uncontrolled month state, day selection, and direct month/year picking.
selectedDatedefaultSelectedDateonSelect(date: Date) => voidmonthDatedefaultMonthDateonMonthChange(month: Date) => voiddisabled(date: Date) => booleanlocaleLocalesize"sm" | "md" | "lg"weekStartsOn0 | 1 | 2 | 3 | 4 | 5 | 6minYearnumbermaxYearnumberControlled mode: pass selected/month and respond to onSelect/onMonthChange.
Uncontrolled mode: omit selected/month and optionally seed with defaultSelected/defaultMonth.
The month and year labels open overlay pickers, so users can jump without losing the existing date-grid motion.
When no defaults are provided, the visible month starts from today and selection stays empty until the user picks a date.
Date math and layout behavior
The grid is rebuilt with date-fns whenever the visible month changes.
The rendered range runs from startOfWeek(startOfMonth(currentMonth)) through endOfWeek(endOfMonth(currentMonth)), so leading and trailing days from adjacent months are always visible.
Days outside the active month remain visible for context and can still be selected. Choosing one switches the visible month and selects that day, unless the date is marked unavailable through disabled.
Weekday headers and the grid start day now follow the provided locale/weekStartsOn settings instead of being hardcoded to English Sunday-first output.
Motion and interaction model
Month transitions, selected-day changes, and the live selection summary each animate independently.
Prev and next controls are real buttons with aria-label values, and each in-month day is rendered as a button with hover and tap motion.
Month/year picker overlays use the same smooth easing as the date grid, while directional grid changes keep the existing staggered day entrance.
The selected day highlight uses a shared layoutId of selected-day so the active surface glides between dates instead of remounting abruptly.
Keyboard users can move through the month with arrow keys, Home/End, and PageUp/PageDown, while the calendar exposes clearer spoken date labels and a live selected-date summary.
This is still not a full calendar input primitive: there is no range or multi-select mode.
Registry bundle
Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.
Dependencies: motion, lucide-react, date-fns.