Components
Charts
Setting UpArea ChartLine ChartBar ChartPie ChartRadar ChartRadial Bar ChartScatter ChartTooltip ChartColors
Color AreaColor FieldColor PickerColor SliderColor SwatchColor Swatch PickerColor ThumbColor WheelDrag and drop
Drop ZoneForms
CheckboxCheckbox GroupFieldFormInput OTPNumber FieldRadio GroupSearch FieldTag FieldText FieldTextareaUtilities
Visually HiddenDate Range Picker
Date Range Pickers are crucial for conveying date-based info effectively, improving user interaction with accurate date selections.
Basic
A range calendar displays one or more date grids and allows users to select a range of dates in a single interaction.
Installation
If you hit any issues, make sure you check out the installation guide here for more information.
Composed Components
When you plug this component from the CLI, it autoloads all the composed components. No need to toss 'em in one at a time.
The Date Range Picker's decked out with several components to make it bangin'.
Manual Installation
Sometimes, using the CLI is the way to go, so make sure you install the necessary dependencies for the components you want to use.
Validation
Ensure that the date range picker is properly filled out by using the isRequired
prop.
Custom Validation
Use the validate
function to implement custom validation rules. It evaluates the current date range and returns error messages if the value doesn't meet your criteria.
Visible Duration
You can control the duration of the visible date range by using the visibleDuration
prop. It accepts an object with the following properties:
years
: The number of years to add or subtract.months
: The number of months to add or subtract.weeks
: The number of weeks to add or subtract.days
: The number of days to add or subtract.
Learn more about the visible duration in the rac documentation.
When you're on mobile, the visible duration will reset to the default value of months: 1
.
Controlled
Take control of your date range picker by passing a value
prop to manage the selected date range.
Tuesday, January 7, 2025 to Sunday, January 19, 2025
2025-01-07 to 2025-01-19
Disabled
When the date range picker is disabled, it becomes non-interactive and is visually represented in a disabled state.