Multi Date Picker
The MultipleDatePicker component allows users to select multiple dates efficiently and intuitively. It features a user-friendly calendar interface where users can pick dates by simply clicking on them.
Installation
Install the package
npm i @start-base/react-form-elements
Add the styles
To use the React form elements styles in a Next.js project, import the styles in your layout.tsx
file.
app/layout.tsx
import "@start-base/react-form-elements/styles.css";
Import the component
import MultipleDatePicker from '@start-base/react-form-elements/MultipleDatePicker';
Usages
API
This component combined with Calendar component and Select component. All props from Calendar component and Select can be passed to this component. The Calendar component is a wrapper around react-day-picker (opens in a new tab) DayPicker component. All props from DayPicker API Reference (opens in a new tab) can be passed to this component.
Name | Type | Default | Description |
---|---|---|---|
name | string | Name of the input | |
label | string | null | Label of the input |
placeholder | string | null | Placeholder of the input |
disableShrink | boolean | false | Position the label outside of the input |
onChange | function | Callback function that is fired when the value changes. | |
inputClassName | string | null | Classname for input element |
labelClassName | string | null | Classname for label element |
errorClassName | string | null | Classname for error element |
errorClassName | string | null | Classname for error element |
disabled | boolean | false | Disable the input |
error | string or boolean or object | null | Error message to display below the input. if value is a boolean input border will be change. Also you can pass schema validator error objects. |
value | array | [] | value array of MultipleDatePicker |
locale | object | null | date-fns locale object |
format | string | MM/dd/yyyy | Date format |
calendarClassName | string | null | Classname for calendar element |
classNames | object | null | ClassNames object for select components |
components | object | null | Components object for select |