Skip to content
Preview

With a time

Preview
UTC

DateField

valuerequired
Day | null
The day, YYYY-MM-DD, or none.
onChangerequired
(day: Day | null) => void
Called with the day picked or typed (every typed day that reads, the same one too), or null when cleared.
onRefuse
(text: string) => void
Called with a typed text it cannot read, or a day past min or max: the field keeps its day and is marked invalid until the text changes, and the product gives the error line through Field's error.
min
Day
The first day that can be picked or typed.
max
Day
The last day that can be picked or typed.
today
Day
The day it is, given by the product so a test and a server agree. Default: the machine's own day.
locale
string
The reader's locale: the day's words, the month names it reads, the calendar's week. Default: the platform's.
size
"sm" | "md" | "lg"
Default: "md"
Beside an Input of the same size.
variant
"default" | "ghost" | "bar" | "edge"
invalid
boolean
Marks it invalid; a surrounding Field with error does it too.
clearable
boolean
false: no clear control, and an emptied text keeps the day.
revealClearOnInteraction
boolean
rootStyle
InputStyle
Typed StyleX override for the field's frame: where it sits and Input's --input-* knobs.

Rest props go to <input> props.

valuerequired
number | null
onChangerequired
(ms: number | null) => void
defaultTime
string
Default: "17:00"
min
number
max
number
clearable
boolean
Default: true
size
"sm" | "md" | "lg"
Default: "md"
The text style it stands in and its height, as Input's: sm 24px Caption, md 28px Body, lg 32px Headline.
invalid
boolean
showZone
boolean
Default: true
aria-label
string
rootStyle
RootStyle
A component's typed override prop: Layout and its documented knobs, each the references it takes or another kit knob of its kind; anything else is a type error at the call site (STYLEX.md).

value
Day | null
Default: null
The day picked, YYYY-MM-DD, or none.
range
{ first: Day; last?: Day | null } | null
A range of days in the place of one: every day from first to last is chosen, the two ends among them, and first alone while the last is still to be pressed. value is not read beside it.
onChange
(day: Day) => void
Called with the day a person picks: a click, or Enter or Space on it.
min
Day
The first day that can be picked; days before it are drawn disabled and the keys skip them.
max
Day
The last day that can be picked.
today
Day
The day it is, given by the product so a test and a server agree. Default: the machine's own day.
locale
string
The reader's locale: the names of months and days, and the week's first day (its week info, Monday where the platform says nothing). Default: the platform's.
rootStyle
RootStyle
Typed StyleX override: where the calendar sits.

Rest props go to <div> props.

State machine

PreviewChoose or type a due date.