Skip to Content
Selection & Dates@hacline/ui/date-picker

DatePicker

Choose a date using text input or a calendar popover.

Usage

Omit children for a unified input shell with an inline calendar icon trigger, optional clearable reset button, format hint, and anchored calendar popover.

Date format: MM/DD/YYYY

Selecting Start and End Dates

Set mode="range" to render start and end inputs inside one shared container with an inline calendar trigger; the popover closes once both endpoints are chosen.

Variants & Sizes

Customize appearance with variant ("default" / "filled") and size ("sm" / "md" / "lg").

Parts

Pass custom children when you need full layout control over the input, trigger, presets, or calendar popup.

PartDescriptionExtended Props
DatePickerClear
Clears the value and focuses the input.
size
DatePickerContent
The popup. Without children it renders Previous, the heading, Next and a grid for each month; every Calendar part works inside it.—
DatePickerHint
The format to type, like "MM/DD/YYYY". The inputs are described by it.—
DatePickerInput
A text input that reads a date typed in the page's language on Enter or blur. end makes it a range's end.
size
DatePickerPreset
Selects the value it holds, like the last 7 days.
size
DatePickerTrigger
Opens the calendar. Named "Choose date" and the date chosen; pass aria-label in another language.
size
CalendarDay
A day. Shows the day of the month unless it has children; arrow keys move between days.—
CalendarGrid
One month's grid, a table. offset picks which of the months shown, from 0. Without children it renders its weekdays and weeks.—
CalendarHeading
The months shown, like "October 2026". Screen readers hear it change.—
CalendarMonthSelect
A native select of the months, in the locale, that turns the first month shown.—
CalendarNext
Shows the month after. Named "Next month"; pass aria-label in another language.—
CalendarPrevious
Shows the month before. Named "Previous month"; pass aria-label in another language.—
CalendarWeekday
A weekday's column header. Shows its name in weekdayFormat unless it has children.—
CalendarWeekdays
The header row of weekday names, a weekday in each column. Its children can be a function of the column's index that renders it, like (index) => <CalendarWeekday index={index} className="…" />.—
CalendarWeeks
The weeks of the grid's month, a row each, with a day in each cell. Its children can be a function of a cell that renders its day, like (cell) => <CalendarDay value={cell.date} className="…" />. A cell that shows nothing stays an empty cell.—
CalendarYearSelect
A native select of the years from min to max, or 10 either side of the year shown.—

Props

Prop

Type

View UI SDK parts and state attributes.