Hooks
Build custom calendar and picker UI while retaining Calix behavior.
Every component is built on hooks. Use them when the supplied DOM does not match your product, while keeping Calix selection logic, keyboard behavior, and accessibility attributes.
useCalendar
useCalendar owns visible months, focused day, selection, constraints, and
prop getters. It accepts the same selection and localization options as
Calendar.
Important return values include grids, weekdays, focusedDate, value,
setValue, select, clear, goToMonth, previous/next month and year
navigation, plus isSelected, isDisabled, and range-state helpers.
Always spread getGridProps and getDayProps onto their matching elements.
getDayProps supplies the button type, ARIA state, roving tabIndex, keyboard
handlers, selection handler, and data-* state.
useDatePicker
useDatePicker combines useCalendar with viewport-safe popover positioning
and popup state. Use it when you need a custom trigger or surface.
Control open state with open, defaultOpen, and onOpenChange. placement
defaults to "bottom-start", offset to 8, and closeOnSelect to true.
useDateInput
Use this hook for a text input bound to calendar date parts. It parses on blur or Enter, normalizes Persian/Arabic-Indic digits, and reports invalid input without replacing the last valid value.
useTime
useTime provides controlled or uncontrolled wall-clock state for a custom
time UI. It exposes value, displayHour, meridiem, setters, and increment
functions that honor hourCycle, minuteStep, and secondStep.
Compound date picker
The standard picker is also available in parts. Root holds the state;
Trigger, Input, and Content consume it through context.
DatePicker.Content renders the default CalendarView unless you pass custom
children. Set portal={false} when the surface must remain in its parent DOM tree.