DatePicker
Calendar in a popover
A date field: a button showing the chosen date, Calendar in a popover below it. The model is an ISO string, or [start, end] with range; locale only shapes the text shown (the model stays ISO), min / max pass through to the calendar. Picking a day closes the popover and returns focus to the field; Esc does the same without picking.
On touch devices (pointer: coarse) single mode renders the platform's <input type="date"> instead — the OS picker is better on a phone than any popover — decided after mount so server and client agree; nativeOnTouch="false" forces the popover everywhere. Inside a BlessField the field's label names it. For a calendar that lives in the page rather than a field, use BlessCalendar directly.
Not inside <p>
The floating panel is a <div>. HTML closes a <p> when it meets a <div>, so a trigger placed inside a paragraph renders differently on the server and the client. Wrap with <span>/<div> instead.
Usage
import { BlessDatePicker } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
id | string | — | |
range | boolean | — | |
min | string | — | |
max | string | — | |
placeholder | string | "Select date" | |
locale | string | "ja-JP" | |
disabled | boolean | — | |
invalid | boolean | — | |
nativeOnTouch | boolean | true | prefer native <input type=date> on coarse pointers (touch) |
size | "md" | "sm" | "lg" | "md" | |
modelValue | string | [string, string] | — |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: string | [string, string] | undefined] |