Vesture

Date & time

DatePicker

A text input plus calendar popover for a single date, with locale-aware typed-input parsing.

DatePicker

Preview

Usage

tsx
import { DatePicker } from "@vesture/react";

<DatePicker value={date} onChange={setDate} minDate={new Date()} locale="en-GB" />

Behavior

  • Typed text is parsed locale-aware and rejects overflow dates (e.g. Feb 31); invalid text reverts to the last valid value on blur.
  • Popover uses a non-modal dialog role and returns focus to the input on close.

Props

PropTypeDefaultDescription
value / defaultValue / onChangeDate | null—onChange receives null when cleared.
minDate / maxDate / isDateDisabledmixed—Same as Calendar.
weekStartsOn0 | 11Sunday or Monday, passed through to the popover's Calendar.
localestring"en-US"Drives input parsing, placeholder, and the Calendar.
placeholderstring—Defaults to a locale-derived format like MM/DD/YYYY.
disabledboolean—Disables the input and the calendar-trigger button.
open / onOpenChangeboolean / fn—Controlled popover state.