DateRangeInput
The DateRangeInput components let the user select a date range with the keyboard.
Import
import { DateRangeInput } from 'rsuite';
Examples
Basic
Rendering...
Customize the date format
Rendering...
Disabled and read only
Rendering...
Controlled vs. uncontrolled value
Rendering...
Accessibility
ARIA properties
- The DateRangeInput component is the
<input type="text">
element. - When the DateRangeInput component is disabled, the
disabled
property is added to the<input>
element. - When the DateRangeInput component is read only, the
readonly
property is added to the<input>
element.
Keyboard interactions
- Use β β keyboard to navigate to the previous or next date segment.
- Use β β keys to increase and decrease values.
- Use Backspace key to delete selected value.
- Use numeric key to update selected value.
Props
<DateRangeInput>
Property | Type(default) |
Description |
---|---|---|
character | string (' ~ ') |
The character between the start and end dates |
defaultValue | [Date, Date]γ‘ null | Default value |
disabled | boolean | Whether disabled the component |
format | string ('yyyy-MM-dd') |
Format of the date when rendered in the input |
onChange | (date: [Date, Date]γ‘ null , event) => void | Callback fired when value changed |
plaintext | boolean | Whether plaintext the component |
readOnly | boolean | Whether read only the component |
size | 'lg'γ‘'md'γ‘'sm'γ‘'xs' ('md') |
Date input can have different sizes |
value | [Date, Date]γ‘ null | The selected value. Used when the component is controlled |