Inputs · DatePickerstable
Date picker
Types or picks one date, or a start and end date, from a calendar. A text field with a calendar button opens a dialog with a month grid; square, flat and token-driven.
Preview
#previewSwitch selection type, size, validation and state. The React and CSS tabs update with the preview.
single · size medium · format DD/MM/YYYY
settlement-date.tsx
import { DatePicker } from "@blade-ai/weft/components/date-picker";
export function SettlementDate({ value, error, onChange }: Props) {
return (
<DatePicker
label="Settlement date"
value={value}
onChange={onChange}
minDate={new Date()}
helpText="Blade AI pays out on this date."
/>
);
}All states
#all-statesTrigger and calendar day states from the Date Picker matrix, shown at size medium.
Default
Hover
Focus-visible
| Mo | Tu | We | Th | Fr | Sa | Su |
|---|---|---|---|---|---|---|
October 2026
Open · single
Filled
Disabled
Read-only
Invalid
Range · filled
Props
#propsBooleans are is-prefixed. Dates are JS Date objects at local midnight. One of label or accessibilityLabel is required.
Prop
Type
Default
Description
selectionType
"single" | "range"
"single"
One date, or a start and end date in one field.
value
Date | null | [Date | null, Date | null]
—
Controlled value. Range uses a [start, end] tuple; either end can be null while picking. Dates are JS Date objects at local midnight.
defaultValue
Date | null | [Date | null, Date | null]
—
Uncontrolled starting value.
onChange
(value) => void
—
Called when the committed value changes (Apply, a pick with no footer, or a valid typed date).
onApply
(value) => void
—
Called with the value when Apply is pressed, before the popup closes.
minDate · maxDate
Date
—
Days outside are disabled in the grid; typed values outside show an error.
isDateDisabled
(date: Date) => boolean
—
Disables single days, for example bank holidays.
isOpen · defaultIsOpen
boolean
false
Controlled / uncontrolled popup state.
onOpenChange
(isOpen: boolean) => void
—
Called when the popup opens or closes.
presets
{ label, value: (today) => [Date, Date] }[]
—
Range shortcuts in a column left of the calendar. Range only. Chips on mobile: UNDEFINED · not built.
showFooterActions
boolean
true
Cancel / Apply footer. When false, a pick commits and closes at once.
picker
"day" | "month" | "year"
"day"
Granularity. Range supports day only. Month and year views are not drawn in Paper: UNDEFINED · needs decision; they fall back to "day".
firstDayOfWeek
0 | 1 | 2 | 3 | 4 | 5 | 6
1
First column of the grid (0 = Sunday).
locale · format
string · string
"en-IN · DD/MM/YYYY"
Month and weekday names, and the typed / displayed format built from DD, MM and YYYY.
label · accessibilityLabel
string
—
Visible label, or an accessible name when there is none. One of the two is required.
helpText · errorText
ReactNode
—
Same as Text Input. errorText shows when validationState = "error" and replaces helpText.
validationState
"none" | "error" | "success"
"none"
Validation feedback.
size
"small" | "medium" | "large"
"medium"
Trigger height 32 · 36 · 48, same as Text Input.
isDisabled · isReadOnly · isRequired
boolean
false
Read-only has no Theme treatment (same gap as Text Input): UNDEFINED · needs decision.
autoFocus · name · testID
boolean · string · string
false
Focuses the text input, never opens the popup · form field name (ISO value) · test selector.
Usage
#usageShort rules for date fields.
Do
Keep the text field editable; the calendar is a helper.
Show the format as the placeholder (DD/MM/YYYY).
Use one range picker for a period, not two single pickers.
Use only Theme tokens for colour and Global tokens for size, spacing and type.
Return focus to the trigger whenever the dialog closes.
Don't
Open the calendar on focus or on autoFocus.
Hide disabled days; mark them aria-disabled instead.
Rely on the lime fill alone to show selection.
Add component tokens (datepicker/*) or round the cells.
Write "Invalid date"; say how to fix it.
Accessibility
#accessibilityAPG date picker dialog: editable field, calendar button, modal grid.
Keyboard
Key
Action
Tab / Shift+Tab
Field → calendar button. Inside the dialog: grid → header → presets → Cancel → Apply (trapped).
Enter · Space · Alt+↓
On the calendar button: open the dialog and focus the selected day (else today).
← / →
Previous / next day.
↑ / ↓
Same weekday previous / next week.
Home / End
First / last day of the week (firstDayOfWeek aware).
PageUp / PageDown
Same day previous / next month (clamped to month length).
Shift+PageUp / PageDown
Same day previous / next year.
Enter / Space (day)
Select the day. Range: first = start, second = end.
Esc
Close, keep the committed value, focus the trigger.
ARIA
Element
Role / attribute
When
input
aria-describedby = id of helpText or errorText
Help or error shown
input
aria-invalid="true" · autocomplete="off"
validationState = "error"
button
aria-label="Choose date" · "Change date, 24/11/2026" · aria-haspopup="dialog" · aria-expanded
Always (range: "Choose date range")
dialog
role="dialog" · aria-modal="true" · aria-label="Choose date"
Open
heading
aria-live="polite" (month/year title)
Open
grid
<table role="grid"> · aria-labelledby = id of the month/year heading
Open
th
abbr = full weekday name
Always
gridcell button
aria-label = full date, plus "start" / "end" in range
Each day
gridcell button
aria-selected="true" (cell) on selected days and range ends
Selected
gridcell button
aria-current="date"
Today
gridcell button
aria-disabled="true"
Outside min/max or isDateDisabled
gridcell button
tabindex 0 on one day (roving), -1 on the rest
Open
Agent Spec
#agent-specMachine-readable spec, tables (a)–(g). Same source as /specs/date-picker.json and llms.txt.
PropertyValueToken
Trigger height32 · 36 · 48size.32 · size.36 · size.48
Trigger padding-x · gap8 · 8 / 12 · 8 / 12 · 8spacing.3 · spacing.3 / spacing.4 · spacing.3
Icon size14 · 16 · 16size.14 · size.16 · size.16
Value font size13 · 13 · 14fonts.size.1200 · fonts.size.1200 · fonts.size.100
Day cell (square)32 · 36 · 40size.32 · size.36 · size.40
Day font size13 · 13 · 14fonts.size.1200 · fonts.size.1200 · fonts.size.100
Calendar padding12 · 12 · 16spacing.4 · spacing.4 · spacing.5
Border · radius1px · 0border.width.thin · border.radius.none
Popover width7 × day size + 2 × padding; presets column 160literal 160 for presets