DateRangeInput
A date range picker input that opens a calendar popover for selecting a start and end date.
Examples
Section titled “Examples”Default
Section titled “Default”(args: DateRangeInputProps) => { const [value, setValue] = useState<DateRange | null>(() => defaultRange); return <DateRangeInput {...args} onChange={setValue} value={value} />;}Clickable Date Text
Section titled “Clickable Date Text”(args: DateRangeInputProps) => { const [value, setValue] = useState<DateRange | null>(() => defaultRange); return <DateRangeInput {...args} onChange={setValue} value={value} />;}Single Date
Section titled “Single Date”(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} />;}With Clear
Section titled “With Clear”Clear Window
(args: DateRangeInputProps) => { const [value, setValue] = useState<DateRange | null>(() => defaultRange); return <DateRangeInput {...args} onChange={setValue} value={value} />;}With Constraints
Section titled “With Constraints”(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} /> );}Disabled Weekends
Section titled “Disabled Weekends”(args: DateRangeInputProps) => { const [value, setValue] = useState<DateRange | null>(() => defaultRange); return ( <DateRangeInput {...args} getIsDateDisabled={date => date.dayOfWeek === 6 || date.dayOfWeek === 7} onChange={setValue} value={value} /> );}Disabled
Section titled “Disabled”<DateRangeInput {...args} onChange={() => {}} value={defaultRange} />Loading
Section titled “Loading”<DateRangeInput {...args} onChange={() => {}} value={defaultRange} />Error Status
Section titled “Error Status”End date must be after start date
(args: DateRangeInputProps) => { const [value, setValue] = useState<DateRange | null>(() => defaultRange); return <DateRangeInput {...args} onChange={setValue} value={value} />;}Warning Status
Section titled “Warning Status”Range exceeds 7 days
(args: DateRangeInputProps) => { const [value, setValue] = useState<DateRange | null>(() => defaultRange); return <DateRangeInput {...args} onChange={setValue} value={value} />;}Single Month
Section titled “Single Month”(args: DateRangeInputProps) => { const [value, setValue] = useState<DateRange | null>(() => defaultRange); return <DateRangeInput {...args} onChange={setValue} value={value} />;}With Description
Section titled “With Description”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> );}Formats
Section titled “Formats”() => { 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> );}Read Only
Section titled “Read Only”<DateRangeInput {...args} onChange={() => {}} value={defaultRange} />DateRangeInput
Section titled “DateRangeInput”A date range picker input that opens a calendar popover for selecting a start and end date.
When isOptional: false, isRequired: false
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS class names applied to the input wrapper. |
data-testid | string | — | Test ID applied to the trigger button. |
getIsDateDisabled | (date: PlainDate) => boolean | — | Returns true for dates that should be disabled. |
description | ReactNode | — | Supporting text rendered below the label. |
format | DateFormat | '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. |
hasClear | boolean | false | Whether to show a clear button when a value is selected. |
isDisabled | boolean | false | Whether the input is disabled. |
isLabelHidden | boolean | false | Whether to visually hide the label. |
isLoading | boolean | false | Whether the input is in a loading state. |
isReadOnly | boolean | false | Whether the value is displayed without allowing focus or interaction. |
label* | string | — | Field label text. |
labelIcon | IconComponent | — | Icon shown before the label. |
labelTooltip | ReactNode | — | Tooltip content shown next to the label. |
max | PlainDate | — | Maximum selectable date. |
min | PlainDate | — | Minimum selectable date. |
numberOfMonths | 1 | 2 | 2 | Number of calendar months shown in the popover. |
onChange* | (value: DateRange | null) => void | — | Called when the selected date range changes. |
placeholder | string | — | Placeholder text shown when no range is selected. |
ref | Ref<HTMLButtonElement> | — | Ref forwarded to the trigger button. |
size | "sm" | "md" | "lg" | 'md' | Visual size of the input. |
status | InputStatus | — | Validation status displayed below the input. |
style | CSSProperties | — | Inline styles applied to the input wrapper. |
value* | DateRange | null | — | Currently selected date range. Pass null for an empty input. |
isOptional | false | — | |
isRequired | false | — |
When isOptional: true, isRequired: false
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS class names applied to the input wrapper. |
data-testid | string | — | Test ID applied to the trigger button. |
getIsDateDisabled | (date: PlainDate) => boolean | — | Returns true for dates that should be disabled. |
description | ReactNode | — | Supporting text rendered below the label. |
format | DateFormat | '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. |
hasClear | boolean | false | Whether to show a clear button when a value is selected. |
isDisabled | boolean | false | Whether the input is disabled. |
isLabelHidden | boolean | false | Whether to visually hide the label. |
isLoading | boolean | false | Whether the input is in a loading state. |
isReadOnly | boolean | false | Whether the value is displayed without allowing focus or interaction. |
label* | string | — | Field label text. |
labelIcon | IconComponent | — | Icon shown before the label. |
labelTooltip | ReactNode | — | Tooltip content shown next to the label. |
max | PlainDate | — | Maximum selectable date. |
min | PlainDate | — | Minimum selectable date. |
numberOfMonths | 1 | 2 | 2 | Number of calendar months shown in the popover. |
onChange* | (value: DateRange | null) => void | — | Called when the selected date range changes. |
placeholder | string | — | Placeholder text shown when no range is selected. |
ref | Ref<HTMLButtonElement> | — | Ref forwarded to the trigger button. |
size | "sm" | "md" | "lg" | 'md' | Visual size of the input. |
status | InputStatus | — | Validation status displayed below the input. |
style | CSSProperties | — | Inline styles applied to the input wrapper. |
value* | DateRange | null | — | Currently selected date range. Pass null for an empty input. |
isOptional* | true | — | |
isRequired | false | — |
When isOptional: false, isRequired: true
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS class names applied to the input wrapper. |
data-testid | string | — | Test ID applied to the trigger button. |
getIsDateDisabled | (date: PlainDate) => boolean | — | Returns true for dates that should be disabled. |
description | ReactNode | — | Supporting text rendered below the label. |
format | DateFormat | '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. |
hasClear | boolean | false | Whether to show a clear button when a value is selected. |
isDisabled | boolean | false | Whether the input is disabled. |
isLabelHidden | boolean | false | Whether to visually hide the label. |
isLoading | boolean | false | Whether the input is in a loading state. |
isReadOnly | boolean | false | Whether the value is displayed without allowing focus or interaction. |
label* | string | — | Field label text. |
labelIcon | IconComponent | — | Icon shown before the label. |
labelTooltip | ReactNode | — | Tooltip content shown next to the label. |
max | PlainDate | — | Maximum selectable date. |
min | PlainDate | — | Minimum selectable date. |
numberOfMonths | 1 | 2 | 2 | Number of calendar months shown in the popover. |
onChange* | (value: DateRange | null) => void | — | Called when the selected date range changes. |
placeholder | string | — | Placeholder text shown when no range is selected. |
ref | Ref<HTMLButtonElement> | — | Ref forwarded to the trigger button. |
size | "sm" | "md" | "lg" | 'md' | Visual size of the input. |
status | InputStatus | — | Validation status displayed below the input. |
style | CSSProperties | — | Inline styles applied to the input wrapper. |
value* | DateRange | null | — | Currently selected date range. Pass null for an empty input. |
isOptional | false | — | |
isRequired* | true | — |