DatePicker
Selects a date from a polished, accessible Calendar popover.
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.
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 31 | 1 | 2 | 3 | 4 | 5 | 6 |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 1 | 2 | 3 | 4 |
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
Framework usage
Switch targets to compare the adapter code. The preview stays visually stable because all three packages share the same tokens andui-* class contract.---
import { DatePicker } from '@santi020k/lumen-astro'
---
<DatePicker name="launch-date" aria-label="Launch date" />import { DatePicker } from '@santi020k/lumen-react'
export const Example = () => (
<>
<DatePicker name="launch-date" aria-label="Launch date" />
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<lumen-date-picker name="launch-date" aria-label="Launch date"></lumen-date-picker>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.
pnpm add @santi020k/lumen-astropnpm add @santi020k/lumen-astrolumen add DatePickerlumen add DatePickerpnpm add @santi020k/lumen-reactpnpm add @santi020k/lumen-reactlumen add DatePicker --target reactlumen add DatePicker --target reactpnpm add @santi020k/lumen-elementspnpm add @santi020k/lumen-elementslumen add DatePicker --target elementslumen add DatePicker --target elementsGlass
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.
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 29 | 30 | 1 | 2 | 3 | 4 | 5 |
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | 1 | 2 |
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Framework usage
Switch targets to compare the adapter code. The preview stays visually stable because all three packages share the same tokens andui-* class contract.---
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>import { DatePicker, Field, Label } from '@santi020k/lumen-react'
export const Example = () => (
<>
<div className="docs-glass-demo" style={{ justifyItems: 'center' }}>
<Field style={{ minWidth: 'min(100%, 22rem)' }}>
<Label htmlFor="glass-launch-date">Launch date</Label>
<DatePicker id="glass-launch-date" glass="subtle" defaultValue="2026-07-24" />
</Field>
</div>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<div class="docs-glass-demo" style="justify-items: center;">
<lumen-field style="min-width: min(100%, 22rem);">
<lumen-label for="glass-launch-date">Launch date</lumen-label>
<lumen-date-picker id="glass-launch-date" glass="subtle" value="2026-07-24"></lumen-date-picker>
</lumen-field>
</div>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.
| Attribute | Values | Default | Description |
|---|---|---|---|
| glass | boolean | "subtle" | "strong" | false | Applies the tokenized liquid-glass surface treatment with backdrop-filter fallbacks; "subtle" and "strong" adjust the fill intensity. |
| value, defaultValue | ISO date string (YYYY-MM-DD) | - | Sets the selected date while the trigger shows a localized, human-readable value. |
| min, max | ISO date string (YYYY-MM-DD) | - | Disables dates and month navigation outside the allowed range. |
| placeholder | string | "Choose a date" | Labels the trigger before a date is selected. |
| UIPrimitives | Astro runtime | required | Enhances the form-backed input into the custom Calendar popover. React and registered Elements provide equivalent behavior. |
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
| ...native attributes | HTML 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.
| Key | Action |
|---|---|
| Enter, Space on trigger | Open the calendar popover. |
| ArrowDown on trigger | Open the calendar and move focus to the selected day, today, or first available day. |
| Arrow keys in calendar | Move focus by day or week without opening a browser-native date picker. |
| PageDown, PageUp in calendar | Move to the same date in the next or previous month. |
| Enter, Space on a day | Select the focused date, close the popover, and return focus to the trigger. |
| Escape | Close the calendar without changing the value and return focus to the trigger. |