RangePicker
@rockshin/tao-uiLets users select a start and end date as one range value.
When to use
Use RangePicker for reporting windows, booking windows, and filters with start/end dates.
Recommended
- Use presets for common ranges such as today, this week, or last 30 days.
- Make inclusive/exclusive range behavior clear when it matters.
Avoid
- Do not use the component outside its intended interaction model.
Examples
Basic usage
Controlled range
Presets and time
Range selection and clearing
Choose the start and end dates in sequence, maintain the range value, and allow clearing.
Range: ? ~ ?
Range presets
Offer common report ranges using the same value structure as manual selections.
Sizes and variants
Choose size and variant to match neighboring input controls.
Status and disabled state
Use error and warning for validation feedback and disabled for unavailable input.
Locale switching
TaoProvider locale updates built-in actions, placeholders, and calendar labels.
Date boundaries
minDate and maxDate constrain input and navigation; this example uses a fixed 2026 range.
Controlled value and clearing
Pass value to control the range and save the value received by onChange. Set value to null to reset the range from your application.
With both endpoints enabled, the built-in clear control reports onChange(null, ['', '']). Since 0.0.49, RangePicker also discards any text still being edited without first emitting it as a selected range.
Display format
format changes display text while values remain Dayjs objects.
Date and time ranges
showTime adds time selection for both endpoints before confirmation.
Month and year ranges
Use picker to select month or year granularity.
Disable one endpoint
A disabled tuple can lock only the start or end input.
Mobile drawer titles use mobileTitle, then the nearest Form.Item / FormField label, then localized default text. Required marks and help text are excluded; placeholders only describe the input. For standalone controls or native HTML labels, pass mobileTitle="Departure date" explicitly.
Mobile selection
Open the picker in phone mode to try selection, confirmation, and clearing inside a drawer.