Searching Open Sourcery

Type to search Open Sourcery.

Inputs & Controls

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.

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

AttributeDefaultDescription
value—Committed ISO date (YYYY-MM-DD), or ISO-8601 interval (start/end) in range mode, or ISO month (YYYY-MM) in month mode
typedatedate (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
positionautoForce panel direction: up or down
localedocument/browserBCP-47 locale for month, weekday, and label formatting
first-day-of-week0Start-of-week day: 0 = Sunday … 6 = Saturday
placeholderSelect a date (Select dates in range mode)Trigger text when no value is set
formatmediumTrigger 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.