Skip to main content
161

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.

AstroSame visual contract, native framework API

Framework usage

Switch targets to compare the adapter code. The preview stays visually stable because all three packages share the same tokens and ui-* class contract.
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.

AstroSame visual contract, native framework API

Framework usage

Switch targets to compare the adapter code. The preview stays visually stable because all three packages share the same tokens and ui-* class contract.
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. React props follow the same names; Elements use equivalent kebab-case attributes where custom elements expose them.

AttributeValuesDefaultDescription
glassboolean | "subtle" | "strong"falseApplies the tokenized liquid-glass surface treatment with backdrop-filter fallbacks; "subtle" and "strong" adjust the fill intensity.
value, defaultValueISO date string (YYYY-MM-DD)-Sets the selected date while the trigger shows a localized, human-readable value.
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 the custom Calendar popover. 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