Skip to content

DateInput

A date picker input that combines a text input with a calendar popover. Users can type a date directly or select one from the calendar.

(args: DateInputProps) => {
const [value, setValue] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 5, 21),
);
return <DateInput {...args} onChange={setValue} value={value} />;
}
(args: DateInputProps) => {
const [value, setValue] = useState<PlainDate | null>(null);
return <DateInput {...args} onChange={setValue} value={value} />;
}
(args: DateInputProps) => {
const [value, setValue] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 5, 21),
);
return (
<DateInput
{...args}
max={plainDateCreate(2026, 5, 28)}
min={plainDateCreate(2026, 5, 10)}
onChange={setValue}
value={value}
/>
);
}
<DateInput
{...args}
onChange={() => {}}
value={plainDateCreate(2026, 5, 21)}
/>
<DateInput
{...args}
onChange={() => {}}
value={plainDateCreate(2026, 5, 21)}
/>
Choose the date this task is due.
(args: DateInputProps) => {
const [value, setValue] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 5, 21),
);
return <DateInput {...args} onChange={setValue} value={value} />;
}
(args: DateInputProps) => {
const [value, setValue] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 5, 21),
);
return <DateInput {...args} onChange={setValue} value={value} />;
}
(args: DateInputProps) => {
const [value, setValue] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 5, 21),
);
return <DateInput {...args} onChange={setValue} value={value} />;
}
(args: DateInputProps) => {
const [value, setValue] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 5, 21),
);
return <DateInput {...args} onChange={setValue} value={value} />;
}
(args: DateInputProps) => {
const [value, setValue] = useState<PlainDate | null>(null);
return <DateInput {...args} onChange={setValue} value={value} />;
}
Date is in the past
(args: DateInputProps) => {
const [value, setValue] = useState<PlainDate | null>(() =>
plainDateCreate(2024, 1, 15),
);
return <DateInput {...args} onChange={setValue} value={value} />;
}
Date is available
(args: DateInputProps) => {
const [value, setValue] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 5, 21),
);
return <DateInput {...args} onChange={setValue} value={value} />;
}
() => {
const [sm, setSm] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 5, 21),
);
const [md, setMd] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 5, 21),
);
const [lg, setLg] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 5, 21),
);
return (
<div style={{display: 'flex', flexDirection: 'column', gap: 16}}>
<DateInput label="Small" onChange={setSm} size="sm" value={sm} />
<DateInput label="Medium" onChange={setMd} size="md" value={md} />
<DateInput label="Large" onChange={setLg} size="lg" value={lg} />
</div>
);
}
January 15, 2026
Jan 15, 2026
2026-01-15
Any function of the selected date
() => {
const [long, setLong] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 1, 15),
);
const [short, setShort] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 1, 15),
);
const [iso, setIso] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 1, 15),
);
const [custom, setCustom] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 1, 15),
);
return (
<div style={{display: 'flex', flexDirection: 'column', gap: 16}}>
<DateInput
description="January 15, 2026"
format="long"
label="Long (default)"
onChange={setLong}
value={long}
/>
<DateInput
description="Jan 15, 2026"
format="short"
label="Short"
onChange={setShort}
value={short}
/>
<DateInput
description="2026-01-15"
format="iso"
label="ISO"
onChange={setIso}
value={iso}
/>
<DateInput
description="Any function of the selected date"
format={date => `${date.month}/${date.day}/${date.year}`}
label="Custom function"
onChange={setCustom}
value={custom}
/>
</div>
);
}
(args: DateInputProps) => {
const [value, setValue] = useState<PlainDate | null>(() =>
plainDateCreate(2026, 5, 21),
);
return <DateInput {...args} onChange={setValue} value={value} />;
}
<DateInput
{...args}
onChange={() => {}}
value={plainDateCreate(2026, 5, 21)}
/>

A date picker input that combines a text input with a calendar popover. Users can type a date directly or select one from the calendar.

When isOptional: false, isRequired: false

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the field root.
data-testidstringTest ID applied to the input element.
descriptionReactNodeSupporting text rendered below the label.
formatDateFormat'long'How the committed date is displayed. Accepts a named preset — 'long' ("January 15, 2026"), 'short' ("Jan 15, 2026"), or 'iso' ("2026-01-15") — or a function receiving the selected date. Typed input is always parsed with the same flexible rules regardless of this prop.
getIsDateDisabled(date: PlainDate) => booleanReturns true for dates that should be disabled.
hasClearbooleanfalseWhether to show a clear button when a value is selected.
htmlIdstringCustom HTML id applied to the input element.
isDisabledbooleanfalseWhether the input is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the input is in a loading state.
isReadOnlybooleanfalseWhether the value is displayed without allowing focus or interaction.
label*stringField label text.
labelIconIconComponentIcon shown before the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxPlainDateMaximum selectable date.
minPlainDateMinimum selectable date.
onChange*(value: PlainDate | null) => voidCalled when the selected date changes.
placeholderstring'e.g. May 21, 2026'Placeholder text shown when no date is selected. Typed dates accept a range of formats, including "May 21, 2026", "5/21/2026", and "2026-05-21".
refRef<HTMLInputElement>Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size of the input.
statusInputStatusValidation status displayed below the input.
styleCSSPropertiesInline styles applied to the field root.
value*PlainDate | nullCurrently selected date. Pass null for an empty input.
isOptionalfalse
isRequiredfalse

When isOptional: true, isRequired: false

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the field root.
data-testidstringTest ID applied to the input element.
descriptionReactNodeSupporting text rendered below the label.
formatDateFormat'long'How the committed date is displayed. Accepts a named preset — 'long' ("January 15, 2026"), 'short' ("Jan 15, 2026"), or 'iso' ("2026-01-15") — or a function receiving the selected date. Typed input is always parsed with the same flexible rules regardless of this prop.
getIsDateDisabled(date: PlainDate) => booleanReturns true for dates that should be disabled.
hasClearbooleanfalseWhether to show a clear button when a value is selected.
htmlIdstringCustom HTML id applied to the input element.
isDisabledbooleanfalseWhether the input is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the input is in a loading state.
isReadOnlybooleanfalseWhether the value is displayed without allowing focus or interaction.
label*stringField label text.
labelIconIconComponentIcon shown before the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxPlainDateMaximum selectable date.
minPlainDateMinimum selectable date.
onChange*(value: PlainDate | null) => voidCalled when the selected date changes.
placeholderstring'e.g. May 21, 2026'Placeholder text shown when no date is selected. Typed dates accept a range of formats, including "May 21, 2026", "5/21/2026", and "2026-05-21".
refRef<HTMLInputElement>Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size of the input.
statusInputStatusValidation status displayed below the input.
styleCSSPropertiesInline styles applied to the field root.
value*PlainDate | nullCurrently selected date. Pass null for an empty input.
isOptional*true
isRequiredfalse

When isOptional: false, isRequired: true

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the field root.
data-testidstringTest ID applied to the input element.
descriptionReactNodeSupporting text rendered below the label.
formatDateFormat'long'How the committed date is displayed. Accepts a named preset — 'long' ("January 15, 2026"), 'short' ("Jan 15, 2026"), or 'iso' ("2026-01-15") — or a function receiving the selected date. Typed input is always parsed with the same flexible rules regardless of this prop.
getIsDateDisabled(date: PlainDate) => booleanReturns true for dates that should be disabled.
hasClearbooleanfalseWhether to show a clear button when a value is selected.
htmlIdstringCustom HTML id applied to the input element.
isDisabledbooleanfalseWhether the input is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the input is in a loading state.
isReadOnlybooleanfalseWhether the value is displayed without allowing focus or interaction.
label*stringField label text.
labelIconIconComponentIcon shown before the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxPlainDateMaximum selectable date.
minPlainDateMinimum selectable date.
onChange*(value: PlainDate | null) => voidCalled when the selected date changes.
placeholderstring'e.g. May 21, 2026'Placeholder text shown when no date is selected. Typed dates accept a range of formats, including "May 21, 2026", "5/21/2026", and "2026-05-21".
refRef<HTMLInputElement>Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size of the input.
statusInputStatusValidation status displayed below the input.
styleCSSPropertiesInline styles applied to the field root.
value*PlainDate | nullCurrently selected date. Pass null for an empty input.
isOptionalfalse
isRequired*true