Skip to content

DateRangeInput

A date range picker input that opens a calendar popover for selecting a start and end date.

(args: DateRangeInputProps) => {
const [value, setValue] = useState<DateRange | null>(() => defaultRange);
return <DateRangeInput {...args} onChange={setValue} value={value} />;
}
(args: DateRangeInputProps) => {
const [value, setValue] = useState<DateRange | null>(() => defaultRange);
return <DateRangeInput {...args} onChange={setValue} value={value} />;
}
(args: DateRangeInputProps) => {
const [value, setValue] = useState<DateRange | null>(() => singleDateRange);
return <DateRangeInput {...args} onChange={setValue} value={value} />;
}
(args: DateRangeInputProps) => {
const [value, setValue] = useState<DateRange | null>(null);
return <DateRangeInput {...args} onChange={setValue} value={value} />;
}
(args: DateRangeInputProps) => {
const [value, setValue] = useState<DateRange | null>(() => defaultRange);
return <DateRangeInput {...args} onChange={setValue} value={value} />;
}
(args: DateRangeInputProps) => {
const [value, setValue] = useState<DateRange | null>(() => defaultRange);
return (
<DateRangeInput
{...args}
max={plainDateCreate(2026, 5, 28)}
min={plainDateCreate(2026, 5, 5)}
onChange={setValue}
value={value}
/>
);
}
(args: DateRangeInputProps) => {
const [value, setValue] = useState<DateRange | null>(() => defaultRange);
return (
<DateRangeInput
{...args}
getIsDateDisabled={date => date.dayOfWeek === 6 || date.dayOfWeek === 7}
onChange={setValue}
value={value}
/>
);
}
<DateRangeInput {...args} onChange={() => {}} value={defaultRange} />
<DateRangeInput {...args} onChange={() => {}} value={defaultRange} />
(args: DateRangeInputProps) => {
const [value, setValue] = useState<DateRange | null>(() => defaultRange);
return <DateRangeInput {...args} onChange={setValue} value={value} />;
}
Range exceeds 7 days
(args: DateRangeInputProps) => {
const [value, setValue] = useState<DateRange | null>(() => defaultRange);
return <DateRangeInput {...args} onChange={setValue} value={value} />;
}
(args: DateRangeInputProps) => {
const [value, setValue] = useState<DateRange | null>(() => defaultRange);
return <DateRangeInput {...args} onChange={setValue} value={value} />;
}
Select a check-in and check-out date.
(args: DateRangeInputProps) => {
const [value, setValue] = useState<DateRange | null>(() => defaultRange);
return <DateRangeInput {...args} onChange={setValue} value={value} />;
}
() => {
const [sm, setSm] = useState<DateRange | null>(() => defaultRange);
const [md, setMd] = useState<DateRange | null>(() => defaultRange);
const [lg, setLg] = useState<DateRange | null>(() => defaultRange);
return (
<div style={{display: 'flex', flexDirection: 'column', gap: 16}}>
<DateRangeInput label="Small" onChange={setSm} size="sm" value={sm} />
<DateRangeInput label="Medium" onChange={setMd} size="md" value={md} />
<DateRangeInput label="Large" onChange={setLg} size="lg" value={lg} />
</div>
);
}
() => {
const [long, setLong] = useState<DateRange | null>(() => januaryRange);
const [short, setShort] = useState<DateRange | null>(() => januaryRange);
const [iso, setIso] = useState<DateRange | null>(() => januaryRange);
return (
<div style={{display: 'flex', flexDirection: 'column', gap: 16}}>
<DateRangeInput
format="long"
label="Long"
onChange={setLong}
value={long}
/>
<DateRangeInput
format="short"
label="Short (default)"
onChange={setShort}
value={short}
/>
<DateRangeInput
format="iso"
label="ISO"
onChange={setIso}
value={iso}
/>
</div>
);
}
<DateRangeInput {...args} onChange={() => {}} value={defaultRange} />

A date range picker input that opens a calendar popover for selecting a start and end date.

When isOptional: false, isRequired: false

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the input wrapper.
data-testidstringTest ID applied to the trigger button.
getIsDateDisabled(date: PlainDate) => booleanReturns true for dates that should be disabled.
descriptionReactNodeSupporting text rendered below the label.
formatDateFormat'short'How each end of the committed range is displayed. Accepts a named preset — 'long' ("January 15, 2026"), 'short' ("Jan 15, 2026"), or 'iso' ("2026-01-15") — or a function receiving the date.
hasClearbooleanfalseWhether to show a clear button when a value is selected.
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.
numberOfMonths1 | 22Number of calendar months shown in the popover.
onChange*(value: DateRange | null) => voidCalled when the selected date range changes.
placeholderstringPlaceholder text shown when no range is selected.
refRef<HTMLButtonElement>Ref forwarded to the trigger button.
size"sm" | "md" | "lg"'md'Visual size of the input.
statusInputStatusValidation status displayed below the input.
styleCSSPropertiesInline styles applied to the input wrapper.
value*DateRange | nullCurrently selected date range. Pass null for an empty input.
isOptionalfalse
isRequiredfalse

When isOptional: true, isRequired: false

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the input wrapper.
data-testidstringTest ID applied to the trigger button.
getIsDateDisabled(date: PlainDate) => booleanReturns true for dates that should be disabled.
descriptionReactNodeSupporting text rendered below the label.
formatDateFormat'short'How each end of the committed range is displayed. Accepts a named preset — 'long' ("January 15, 2026"), 'short' ("Jan 15, 2026"), or 'iso' ("2026-01-15") — or a function receiving the date.
hasClearbooleanfalseWhether to show a clear button when a value is selected.
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.
numberOfMonths1 | 22Number of calendar months shown in the popover.
onChange*(value: DateRange | null) => voidCalled when the selected date range changes.
placeholderstringPlaceholder text shown when no range is selected.
refRef<HTMLButtonElement>Ref forwarded to the trigger button.
size"sm" | "md" | "lg"'md'Visual size of the input.
statusInputStatusValidation status displayed below the input.
styleCSSPropertiesInline styles applied to the input wrapper.
value*DateRange | nullCurrently selected date range. Pass null for an empty input.
isOptional*true
isRequiredfalse

When isOptional: false, isRequired: true

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the input wrapper.
data-testidstringTest ID applied to the trigger button.
getIsDateDisabled(date: PlainDate) => booleanReturns true for dates that should be disabled.
descriptionReactNodeSupporting text rendered below the label.
formatDateFormat'short'How each end of the committed range is displayed. Accepts a named preset — 'long' ("January 15, 2026"), 'short' ("Jan 15, 2026"), or 'iso' ("2026-01-15") — or a function receiving the date.
hasClearbooleanfalseWhether to show a clear button when a value is selected.
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.
numberOfMonths1 | 22Number of calendar months shown in the popover.
onChange*(value: DateRange | null) => voidCalled when the selected date range changes.
placeholderstringPlaceholder text shown when no range is selected.
refRef<HTMLButtonElement>Ref forwarded to the trigger button.
size"sm" | "md" | "lg"'md'Visual size of the input.
statusInputStatusValidation status displayed below the input.
styleCSSPropertiesInline styles applied to the input wrapper.
value*DateRange | nullCurrently selected date range. Pass null for an empty input.
isOptionalfalse
isRequired*true