Skip to content

Commit f61aeb9

Browse files
committed
chore: add readme to date range picker
1 parent f0cbe89 commit f61aeb9

File tree

1 file changed

+29
-0
lines changed
  • packages/react-material-ui/src/components/DateRangePicker

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# DateRangePicker
2+
3+
The DateRangePicker is a custom set of inputs that deal with a range of dates. It is composed by a fieldset with two inputs with type date inside, each one handling half of the date range.
4+
5+
## Example
6+
7+
The following example describes the full composition that mounts the Filter component:
8+
9+
```tsx
10+
import { DateRangePicker } from '@concepta/react-material-ui';
11+
12+
<DateRangePicker
13+
label="Date range"
14+
error="Error message"
15+
sx={{ margin: '16px' }}
16+
onRangeUpdate={(range) => setDateRangeOnState(range)}
17+
/>;
18+
```
19+
20+
## Props
21+
22+
| Name | Type | Description | Optional |
23+
| --- | --- | --- | --- |
24+
| label | `string` | The label of the field, similar to MUI's `Input` | No
25+
| error | `string` | Error message displayed on the bottom of the field | No
26+
| sx | `object` | Custom styles to be applied to the fieldset container | No
27+
| onRangeUpdate | `function` | Handler for updates in the date range. Returns an object containing `startDate` and `endDate` | No
28+
29+
> The rest of the DateRangePicker props extend from [HTML `fieldset`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset).

0 commit comments

Comments
 (0)