@wjkang/react-ui-date-picker
v1.1.0
Published
A simple date-picker React UI component
Downloads
9
Maintainers
Readme
React Simple Multi-Date Picker
A simple date picker React component
Available Props
| Props | Type | Default |
| :---------------------- | :----------------------------: | :--------------------: |
| onChange | (selectedDate: Date[]) => void | - |
| width | string | '100%'
|
| singleSelect | boolean | false
|
| headerFormat | string | 'MMM, Y'
|
| selectedBackgroundColor | string | 'rgb(168,85,247)'
|
| selectedTextColor | string | 'rgb(255, 255, 255)'
|
| textColor | string | 'rgb(51, 51, 51)'
|
| disableResetButton | boolean | false
|
| disableTodayButton | boolean | false
|
| allowPastSelect | boolean | false
|
Installation
npm install @wjkang/react-ui-date-picker date-fns
Example
Allow access to selected values by onChange
callback
import { useState } from 'react';
import { DatePicker } from '@wjkang/react-ui-date-picker';
export default function CallbackExample() {
const [selectedDate, setSelectedDate] = useState<Date[]>([]);
return <DatePicker onChange={setSelectedDate} />;
}