nalarx-ui
Components

Date picker

A date field that opens a month calendar in the app's theme.

bunx shadcn@latest add @nalarx/date-picker

Usage

The value is a local date as "YYYY-MM-DD", or "" when nothing is picked. The whole field opens the calendar; picking a day, Today or Clear closes it.

const [start, setStart] = useState("");

<DatePicker value={start} onChange={setStart} ariaLabel="Start date" />

Empty with the placeholder, with a value, and disabled:

The open panel, also exported as Calendar. Today is 13 November here, 20 November is picked, and the late-October and December days are faded but still pickable:

November 2026
MTWTFSS
November 2026
MTWTFSS

Month and weekday names, the placeholder, Today, Clear and the month buttons' labels come from UIStringsProvider (locale, datePlaceholder, today, clear, previousMonth, nextMonth). Weeks start on Monday.

Keyboard

KeyDoes
Enter, Space on the fieldOpens the calendar and focuses the picked day, else today.
← →Previous or next day.
↑ ↓Same day in the previous or next week.
Home, EndMonday or Sunday of the week.
PageUp, PageDownSame day in the previous or next month (clamped to the month's last day).
Shift + PageUp, PageDownSame day in the previous or next year.
Enter, Space on a dayPicks it and closes.
TabMoves between the month buttons, the days and Clear / Today.
EscapeCloses and returns focus to the field.

Moving past the shown month switches the month.

Props

DatePicker

PropTypeDefault
valuestring"YYYY-MM-DD" or "".
onChange(value: string) => void"" after Clear.
ariaLabelstringNames the field and the calendar; the picked date is appended to the field's name.
widthnumber | string168px, or any CSS length.
heightnumber40px.
disabledbooleanfalse
placeholderstringdatePlaceholder string
minstring"YYYY-MM-DD": earlier days are disabled and Today hides when it is earlier.
id, className, refOn the field button.

Calendar

PropTypeDefault
valuestring"YYYY-MM-DD" or "".
onChange(value: string) => void
todaystringthe device's date at mountPass it when "today" must follow another time zone.
minstringSame as on DatePicker.
classNamestring

Replaces

DatePicker in apps/web/src/components/ui/DatePicker.tsx (used by the automation form) and apps/web/src/lib/shared/ui/calendarGrid.ts. The Platform app has none.

On this page