Skip to main content
196

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Web docs
FormsGlass surface

DatePicker

Selects a date from a polished, accessible Calendar popover.

FrameworksAstro · React · Elements

Registry commandlumen add DatePicker

InteractionEnhanced runtime

01

See it and copy it

Framework example

Choose Astro, React, or Elements to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.

AstroCode target · live preview uses Astro
View DatePicker code

Framework usage

Switch targets to compare the adapter code. This live preview runs the Astro example. React and Elements use their own behavior APIs; complete the matching framework setup before copying an example.
astro
---
import { DatePicker } from '@santi020k/lumen-astro'
---

<DatePicker name="launch-date" aria-label="Launch date" />
Edit DatePicker in browser
02

Choose your target

Add this component

Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.

bash@santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
bashAstro wrapper
lumen add DatePicker
lumen add DatePicker

Glass

Add the glass prop to apply the shared blur, saturation, border, and highlight tokens. Glass reads best over vivid content, so place the surface above imagery or color.

AstroCode target · live preview uses Astro
View DatePicker code

Framework usage

Switch targets to compare the adapter code. This live preview runs the Astro example. React and Elements use their own behavior APIs; complete the matching framework setup before copying an example.
astro
---
import { DatePicker, Field, Label } from '@santi020k/lumen-astro'
---

<div class="docs-glass-demo" style="justify-items: center;">
  <Field style="min-width: min(100%, 22rem);">
    <Label for="glass-launch-date">Launch date</Label>
    <DatePicker id="glass-launch-date" glass="subtle" value="2026-07-24" />
  </Field>
</div>
Edit DatePicker in browser

API reference

Lumen-specific props and runtime attributes for the Astro primitive. Use the framework differences above and the copyable examples for React composition and Elements attributes; the public adapter types define their supported contracts.

AttributeValuesDefaultDescription
glassboolean | "subtle" | "strong"falseApplies the tokenized liquid-glass surface treatment with backdrop-filter fallbacks; "subtle" and "strong" adjust the fill intensity.
aria-invalid, aria-describedby, aria-errormessagenative input ARIA attributes-Mirrored to the visible trigger. Application errors retain precedence. Elements consumers put these attributes on the authored data-ui-date-picker-native input, not the custom-element host.
value, defaultValueISO date string (YYYY-MM-DD)-Sets the selected date while the trigger shows a localized, human-readable value. React reopens the calendar on the selected month.
min, maxISO date string (YYYY-MM-DD)-Disables dates and month navigation outside the allowed range.
placeholderstring"Choose a date"Labels the trigger before a date is selected.
UIPrimitivesAstro runtimerequiredEnhances the form-backed input into a floating Calendar popover that follows scroll and resize and uses the top layer when supported. React and registered Elements provide equivalent behavior.
class, classNamestring""Merges custom classes with the generated ui-* root classes.
...native attributesHTML attributes-Forwards standard attributes to the root element unless the component consumes them.

Keyboard interactions

Keyboard behavior provided by the Astro UIPrimitives runtime for this component.

KeyAction
Enter, Space on triggerOpen the calendar popover.
ArrowDown on triggerOpen the calendar and move focus to the selected day, today, or first available day.
Arrow keys in calendarMove focus by day or week without opening a browser-native date picker.
PageDown, PageUp in calendarMove to the same date in the next or previous month.
Enter, Space on a daySelect the focused date, close the popover, and return focus to the trigger.
EscapeClose the calendar without changing the value and return focus to the trigger.

Web docsFull catalog