Forms
DateRangeInput
Segmented start – end date field with a range calendar popover.
import { DateRangeInput } from "datui";Playground
<DateRangeInput closeOnChange status="default" />Examples
Basic
Check-in – check-out
Accessibility
- One
role="group"holding six labelled spinbutton segments ("Start day" … "End year"); name the group witharia-labeloraria-labelledby. - Keys work as in DateInput; Left/Right and Backspace cross between the start and end segments. A typed end before the start is swapped.
- The range calendar opens in a focus-trapped dialog and closes once both ends are chosen (with
closeOnChange); focus returns to the calendar button.
API
DateRangeInput
Segmented start – end date field (DD.MM.YYYY – DD.MM.YYYY) with a range calendar popover. Keys work as in DateInput; Left/Right and Backspace cross between the two ends.
| Prop | Type | Default | Description |
|---|---|---|---|
| after | ReactNode | — | Content after the control, e.g. an icon, clear button or unit. |
| before | ReactNode | — | Content before the control, usually an icon. |
| calendarLabel | string | Calendar | |
| calendarPlacement | Placement | bottom-start | |
| changeEndDayLabel | string | End day | |
| changeEndMonthLabel | string | End month | |
| changeEndYearLabel | string | End year | |
| changeMonthLabel | string | "Month" | |
| changeStartDayLabel | string | Start day | |
| changeStartMonthLabel | string | Start month | |
| changeStartYearLabel | string | Start year | |
| changeYearLabel | string | "Year" | |
| className | string | — | |
| clearFieldLabel | string | Clear | |
| closeOnChange | boolean | true | Close the calendar once both ends are picked. |
| defaultValue | CalendarRangeValue | null | |
| disableCalendar | boolean | false | |
| disabled | boolean | — | |
| disableFuture | boolean | — | |
| disablePast | boolean | — | |
| name | string | — | Form field name; hidden inputs submit `<name>[start]` and `<name>[end]` ISO strings. |
| nextMonthLabel | string | "Next month" | |
| onCalendarOpenChange | ((open: boolean) => void) | — | |
| onChange | ((value: CalendarRangeValue) => void) | — | Called with `[start, end]` (either may be `null`); a typed end before the start is swapped. |
| prevMonthLabel | string | "Previous month" | |
| readOnly | boolean | — | |
| shouldDisableDate | ((date: Date) => boolean) | — | |
| showCalendarLabel | string | Show calendar | |
| status | FormFieldStatus | "default" | Visual validation state. Pair `error` with `aria-invalid` on the control (FormItem does this). |
| value | CalendarRangeValue | — | |
| weekStartsOn | 0 | 1 | 4 | 2 | 3 | 5 | 6 | 1 |