Rebar UI

1.0

opinion

DatePicker

Day, month, year: typed, not browsed.

Due dateThree bounded fields; the day re-bounds to the month
Due date

Sat, 24 Oct 2026 · Harbour launch

Bounded to October
Error

Due date can’t be in the past.

Disabled

In context

Rota exportA range in a form, and a due date on a phone
Rota export
From
To
7 days, 4 people, 109 hours.

New task

Title
Due date

Date of birth

Year-first pickermode="dob": pick the year, then the month, then the day; OK stays disabled until the date is valid
Your details

We ask to confirm you’re old enough to use Athic.

Inline
Popover

Props

PropTypeRequiredDefault
rangefalse | undefinedNo—
mode"single" | undefinedNo—
valueDate | undefinedNo—
defaultValueDate | undefinedNo—
onValueChange((date: Date) => void) | undefinedNo—
minDateDate | undefinedNo—
maxDateDate | undefinedNo—
disabledboolean | undefinedNo—
placeholderstring | undefinedNo—
appearance"default" | "native" | undefinedNo—
requiredboolean | undefinedNo—

Accessibility

A role="group" labelled "Date" holding three real NumberInputs (Day, Month, Year), each with its own label and bounds; arrow keys step a field, and the day field re-bounds itself to the month. No calendar popover to trap focus in.

data-rebar-* attributes

data-rebar-component="date-picker" on the root; parts day, month, year (each a real NumberInput with its own data-rebar-component="number-input").

Migrating to Ant Design

Not a structural match: AntD's DatePicker is a calendar popover. A migration uses that when browsing is the point, or three plain InputNumbers to keep this compact direct-entry shape.

Typed onValueChange

onValueChange is typed per mode, so an inline callback needs no annotation: (date: Date) by default, mode="single" and mode="dob", and (range: { start: Date; end: Date }) for range or mode="range". Mixing them (a range handler on a single picker) is a type error.

<DatePicker onValueChange={(d) => setDate(d)} />\n<DatePicker mode="range" onValueChange={(r) => setRange(r)} />

appearance="native"

appearance="native" renders the platform date input (<input type="date">) with the same Date value API (value, defaultValue, onValueChange, minDate, maxDate), also for mode="dob". Single dates only.