Range Date Picker
Range date pickers let users select a start date and end date together.
Component Variations
Basic Range Date Picker
Date picker for selecting a date range
States
Contains: Default, Success, Error, Warning
Dropdown Positions
Contains: Bottom-Left, Bottom-Center, Bottom-Right, Top-Left, Top-Center, Top-Right
Input Field Variations
Contains: Optional Label, Hint Text, Helper Text, Leading Icon
Optional
Optional
Usage Guidelines
1. Import
Import the range date picker component:
import-range-date-picker.ts
Copy code
2. Basic Usage
Simplest form of the range date picker:
basic-usage-example.html
Copy code
3. Dropdown Position
Control the calendar dropdown position:
dropdown-position-example.html
Copy code
4. All API Usage
Comprehensive example with all available properties and events:
range-date-picker-all-api.html
Copy code
API Reference
Inputs
Properties that can be passed to the component:
Property | Type | Default | Required | Description |
|---|---|---|---|---|
string | - | No | Label text displayed above the date range picker | |
string | 'Select date range' | No | Placeholder text shown when no date range is selected | |
DateRange | null | null | No | Currently selected date range with start and end dates | |
boolean | false | No | Whether the date range picker is disabled | |
boolean | false | No | Whether the date range picker is optional | |
'success' | 'error' | 'warning' | null | null | No | Visual state of the date range picker | |
string | - | No | Helper text displayed below the date range picker | |
string | - | No | Hint text displayed in tooltip on ? icon next to label | |
'bottom-left' | 'bottom-center' | 'bottom-right' | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | No | Position of the dropdown calendar relative to the input field | |
Date | - | No | Minimum selectable date |
Outputs
Events emitted by the component:
Property | Type | Description | Format |
|---|---|---|---|
EventEmitter<DateRange | null> | Emitted when the selected date range changes | { start: Date | null, end: Date | null } or null | |
EventEmitter<void> | Emitted when the input receives focus | No payload | |
EventEmitter<void> | Emitted when the input loses focus | No payload |
Inputs
Property | Type | Default | Required | Description |
|---|---|---|---|---|
string | - | No | Label text displayed above the date range picker | |
string | 'Select date range' | No | Placeholder text shown when no date range is selected | |
DateRange | null | null | No | Currently selected date range with start and end dates | |
boolean | false | No | Whether the date range picker is disabled | |
boolean | false | No | Whether the date range picker is optional | |
'success' | 'error' | 'warning' | null | null | No | Visual state of the date range picker | |
string | - | No | Helper text displayed below the date range picker | |
string | - | No | Hint text displayed in tooltip on ? icon next to label | |
'bottom-left' | 'bottom-center' | 'bottom-right' | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | No | Position of the dropdown calendar relative to the input field | |
Date | - | No | Minimum selectable date |
DateRange Interface
The value property accepts an object with the following structure:
date-range-interface.ts
Copy code
Best Practices
When to Use
- Use Range Date Picker when this pattern clearly supports the user task.
- Use it to keep similar interactions consistent across the product.
When Not to Use
- Avoid using Range Date Picker when a simpler component communicates the same intent.
- Avoid using it when the pattern introduces unnecessary interaction steps.
Design Guidelines
- Always provide clear labels indicating that a date range is expected
- Use helper text to clarify the date range format or constraints
- Set min and max dates to constrain valid selections
- Use state prop to provide validation feedback for invalid ranges
- Consider pre-selecting common date ranges (last 7 days, last month, etc.)
- Validate that the end date is after the start date
- Provide meaningful error messages for invalid date range selections
- Consider the typical use case when choosing dropdown position
- Use consistent date formats across your application
- Keep labels, helper text, and actions concise and easy to scan.
- Use VD variants and states consistently for predictable behavior.
- Ensure keyboard access and clear focus order for accessibility.
Playground
Customize the range date picker features
example.html
Copy code