react-date-range-headless
Version:
A React component for choosing dates and date ranges. A fork of hypeserver/react-date-range in which the Headless UI Listbox (Select) uses instead html select and options
31 lines (26 loc) • 800 B
Markdown
This component extends all the props of **[Calendar](#calendar)** component. In addition to those props, it has the following props:
| Prop Name | Type |
|---|---|
| **moveRangeOnFirstSelection** | boolean |
| **retainEndDateOnFirstSelection** | boolean |
| **disableReverseDates** | boolean |
| **onRangeFocusChange** | function |
| **rangeColors** | array |
| **ranges** | array |
#### Example: Editable Date Inputs
```jsx inside Markdown
import {useState} from 'react'
const [state, setState] = useState([
{
startDate: new Date(),
endDate: null,
key: 'selection'
}
]);
<DateRange
editableDateInputs={true}
onChange={item => setState([item.selection])}
moveRangeOnFirstSelection={false}
ranges={state}
/>
```