forms / stable
DatePicker
Date field with typeable, locale-ordered segments and a calendar popover. DateRangePicker does periods.
LIVE PREVIEW
Loading preview…
When to use
- Dates in forms and filters (due date, invoice date).
- Periods — DateRangePicker.
Consider an alternative
- An always-visible month — use Calendar.
- Relative choices (“Next week”) — use Select.
Import
import { DatePicker } from '@revido-llc/kit';Keyboard interaction
- Ghost: Enter / Space / ↓ — open calendar and date fields
- ↑ / ↓ — change segment
- Type digits — fill segment
- ← / → — move between segments
- Enter in popover fields — done
- Escape — close and return focus
- Outline: Alt + ↓ — open calendar
Props
Props documented by the Kit. Refer to the TypeScript types for the complete interface, including inherited props.
Related exports
DateRangePicker
Examples
Dates and local timestamps
CalendarDateTime supplies time segments with minute granularity. Keep existing timestamp-to-local conversion in the app; use numeric display to retain the visible time.
import { DatePicker, parseDateTime, type CalendarDateTime } from "@revido-llc/kit";
// Preserve the app's timestamp ↔ local conversion; parseDateTime accepts no timezone suffix.
const value: CalendarDateTime | null = localValue ? parseDateTime(localValue) : null;
<DatePicker label="Introduction at" value={value} granularity="minute" hourCycle={24}
onChange={(next) => persistLocalDateTime(next?.toString() ?? null)} />Display formats
Shown when the field isn't being edited; focus it to type.
<DatePicker label="Due" displayFormat="month-day" defaultValue={parseDate("2026-09-26")} />Range
<DateRangePicker label="Reporting period" value={range} onChange={setRange} />Compact and invalid
<DatePicker aria-label="Start" size="compact" />
<DatePicker label="Deadline" minValue={start} errorMessage="Pick a date after the start." />Static anatomy
A literal starting point; bind selection and validation in the consuming app.
<DateRangePicker label="Dates" />Ghost rail values
Press the value to open date fields above the calendar. Clear or Done closes the popover; Escape returns focus.
<DatePicker aria-label="QA due" variant="ghost" emptyLabel="Add date" size="compact" suffix={<span className="text-2xs text-foreground-tertiary">Auto</span>} />
<DateRangePicker aria-label="Dates" variant="ghost" size="compact" />Related components
- Calendar ↗
- RangeCalendar