Forms
DatePicker
A date picked from a calendar in a popover: a day, a range with quick presets, a month or a year. The trigger has the look of an Input and takes a Field's label and error. It closes on a pick, or when a range has both ends. appearance="inline" drops the frame for a toolbar.
Preview
Installation
// Resolves dependencies, copies the source, and installs npm packages automatically.
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| mode | "single" | "range" | "single" | A range closes the popover once it has both ends |
| granularity | "day" | "month" | "year" | "day" | The value is YYYY-MM-DD, YYYY-MM or YYYY |
| presets | { label; value: { start; end } }[] | - | Ranges one click away, beside the calendar |
| min / max / isDisabled | string / string / (day) => boolean | - | What cannot be picked |
| appearance | "field" | "inline" | "field" | inline drops the field's frame |