Skip to content
ArcadiaDesign

TSX

A day in a form. The field shows the day in words and opens a Calendar in a popover on a click or the down arrow; a day can be typed instead. A day is the string YYYY-MM-DD everywhere, with no zone and no time, and onChange gets that string, or null when the field is cleared. The product passes today, so its server and its tests agree; without it the field reads the machine's clock.

It reads seven forms and no others: 2026-11-21, 21 Nov, Nov 21, 21 Nov 2027, Nov 21, 2027, today and tomorrow, the month as the reader's locale writes it, short or long. A day with no year is in today's. A text it cannot read keeps the old day, marks the field invalid and calls onRefuse; the error line is the product's, through Field.

Examples

Calendar

One month: today with an ink outline, the picked day on the selected fill, the neighbouring months faint and still a press away, the days past min and max disabled.

November 2026
Sun
Mon
Tue
Wed
Thu
Fri
Sat

The reader's week

The week starts where the reader's locale says: Sunday in the United States, Monday in Britain and wherever the platform says nothing.

November 2026
Sun
Mon
Tue
Wed
Thu
Fri
Sat
November 2026
Mon
Tue
Wed
Thu
Fri
Sat
Sun

Sizes

The heights of Input, so a day sits in a form beside any other field.

Size

A day in words

formatDay writes a day one way for a card's face, a field and a list: Today, Tomorrow and Yesterday by name, else the month and the day, with the year when it is not today's.

The day

The field is a combobox that opens a dialog: aria-expanded says whether the calendar shows. A click leaves the caret in the field; the down arrow moves focus onto the picked day, or today. The calendar is a grid labelled by its month, which is a live region, so a new month is read when it changes. Each day is named in full (Saturday, November 21, 2026), today is aria-current, the picked day aria-selected.

↓
In the field: open the calendar, focus on its day
←→
A day back or on
↑↓
A week back or on
Page UpPage Down
A month back or on, a year with Shift
HomeEnd
The week's first or last day
EnterSpace
Pick the day
Esc
Close the calendar, focus back in the field

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.
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.
rootStyle
InputStyle
Typed StyleX override for the field's frame: where it sits and Input's --input-* knobs.

Rest props go to <input> props.

value
Day | nullDefault null
The day picked, YYYY-MM-DD, or none.
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.