Date Picker
A calendar popover with keyboard navigation, ranges, and locales.
unreleased@magic-spells/date-picker
Not on the registry yet — clone or read it on GitHub.
Usage
<date-picker name="delivery-date" value="2026-07-22" min="2026-07-16" max="2026-12-31"> <date-picker-trigger> <!-- a <button> showing the formatted date is generated if you don't author one --> </date-picker-trigger> <date-picker-panel> <!-- header, weekday row, and day grid are generated automatically --> </date-picker-panel> </date-picker>
About
A lightweight, accessible calendar date picker popover web component. A trigger shows a panel with a month header (previous/next navigation and a localized month/year label), a weekday row, and a 6-week day grid. Selecting a day commits immediately — updating the value attribute, the hidden form input, and the trigger label — then hides the panel. Locale-aware, keyboard-navigable, with min/max range limits. Zero dependencies, no Shadow DOM.
Attributes
| Attribute | Default | Description |
|---|---|---|
| value | — | Committed ISO date (YYYY-MM-DD), or ISO-8601 interval (start/end) in range mode, or ISO month (YYYY-MM) in month mode |
| type | date | date (default) or month for a month-only picker (see Month-only mode) |
| range | — | Enables range (start–end) selection |
| name | — | Creates a hidden input for form submission (two, -start/-end, in range mode) |
| min | — | Earliest selectable ISO date |
| max | — | Latest selectable ISO date |
| disabled | — | Blocks the panel from showing |
| position | auto | Force panel direction: up or down |
| locale | document/browser | BCP-47 locale for month, weekday, and label formatting |
| first-day-of-week | 0 | Start-of-week day: 0 = Sunday … 6 = Saturday |
| placeholder | Select a date (Select dates in range mode) | Trigger text when no value is set |
| format | medium | Trigger label Intl.DateTimeFormat dateStyle: full/long/medium/short |
The README lists more — see it on GitHub.
About, features, usage and options are taken from the package README.