Calendar
Presents a calendar surface for date selection.
- Frameworks
- Astro · React · Elements · Dioxus
- Registry
lumen add Calendar- Interaction
- Enhanced runtime
See it and copy it
Framework example
Choose Astro, React, Elements, or Dioxus 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 |
|---|---|---|---|---|---|---|
| 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 |
| 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 |
| 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 |
View Calendar code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. Before copying an example, complete the matching framework setup; React, Elements, and Dioxus use their own behavior APIs.Width controls resize the preview container. Resize your browser to test viewport breakpoints.---
import { Button, Calendar, Field, Grid, Label, Stack } from '@santi020k/lumen-astro'
---
<Stack style="max-width: 42rem">
<Grid minItemWidth="17rem" style="align-items: start;">
<Field>
<Label id="ex-calendar-basic-label">Project month</Label>
<Calendar aria-labelledby="ex-calendar-basic-label" month="2026-07" />
</Field>
<Field>
<Label id="ex-calendar-selected-label">Selected milestone</Label>
<Calendar aria-labelledby="ex-calendar-selected-label" value="2026-07-14" />
</Field>
</Grid>
<Grid minItemWidth="17rem" style="align-items: start;">
<Field>
<Label id="ex-calendar-bounds-label">Booking window</Label>
<Calendar
aria-labelledby="ex-calendar-bounds-label"
max="2026-07-24"
min="2026-07-08"
month="2026-07"
/>
</Field>
<form style="display: grid; gap: 0.75rem;">
<Field>
<Label id="ex-calendar-form-label">Delivery date</Label>
<Calendar
aria-labelledby="ex-calendar-form-label"
max="2026-08-31"
min="2026-07-01"
month="2026-07"
name="deliveryDate"
value="2026-07-20"
/>
</Field>
<Button type="submit">Save date</Button>
</form>
</Grid>
</Stack>import { Button, Calendar, Field, Grid, Label, Stack } from '@santi020k/lumen-react'
export const Example = () => (
<>
<Stack style={{ "maxWidth": "42rem" }}>
<Grid minItemWidth="17rem" style={{ "alignItems": "start" }}>
<Field>
<Label id="ex-calendar-basic-label">Project month</Label>
<Calendar aria-labelledby="ex-calendar-basic-label" month="2026-07" />
</Field>
<Field>
<Label id="ex-calendar-selected-label">Selected milestone</Label>
<Calendar aria-labelledby="ex-calendar-selected-label" value="2026-07-14" />
</Field>
</Grid>
<Grid minItemWidth="17rem" style={{ "alignItems": "start" }}>
<Field>
<Label id="ex-calendar-bounds-label">Booking window</Label>
<Calendar
aria-labelledby="ex-calendar-bounds-label"
max="2026-07-24"
min="2026-07-08"
month="2026-07"
/>
</Field>
<form style={{ "display": "grid", "gap": "0.75rem" }}>
<Field>
<Label id="ex-calendar-form-label">Delivery date</Label>
<Calendar
aria-labelledby="ex-calendar-form-label"
max="2026-08-31"
min="2026-07-01"
month="2026-07"
name="deliveryDate"
value="2026-07-20"
/>
</Field>
<Button type="submit">Save date</Button>
</form>
</Grid>
</Stack>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<lumen-stack style="max-width: 42rem">
<lumen-grid style="align-items: start; --ui-grid-min: 17rem">
<lumen-field>
<lumen-label id="ex-calendar-basic-label">Project month</lumen-label>
<lumen-calendar aria-labelledby="ex-calendar-basic-label" month="2026-07"></lumen-calendar>
</lumen-field>
<lumen-field>
<lumen-label id="ex-calendar-selected-label">Selected milestone</lumen-label>
<lumen-calendar aria-labelledby="ex-calendar-selected-label" value="2026-07-14"></lumen-calendar>
</lumen-field>
</lumen-grid>
<lumen-grid style="align-items: start; --ui-grid-min: 17rem">
<lumen-field>
<lumen-label id="ex-calendar-bounds-label">Booking window</lumen-label>
<lumen-calendar
aria-labelledby="ex-calendar-bounds-label"
max="2026-07-24"
min="2026-07-08"
month="2026-07"></lumen-calendar>
</lumen-field>
<form style="display: grid; gap: 0.75rem;">
<lumen-field>
<lumen-label id="ex-calendar-form-label">Delivery date</lumen-label>
<lumen-calendar
aria-labelledby="ex-calendar-form-label"
max="2026-08-31"
min="2026-07-01"
month="2026-07"
name="deliveryDate"
value="2026-07-20"></lumen-calendar>
</lumen-field>
<lumen-button type="submit">Save date</lumen-button>
</form>
</lumen-grid>
</lumen-stack>use dioxus::prelude::*;
use lumen_dioxus::prelude::*;
#[component]
fn Example() -> Element {
let mut due = use_signal(|| "2024-03-12".to_string());
rsx! {
Calendar {
value: due(),
min: "2024-03-01",
max: "2024-04-30",
on_value_change: move |date| due.set(date),
}
}
}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-astrolumen add Calendarpnpm add @santi020k/lumen-reactlumen add Calendar --target reactpnpm add @santi020k/lumen-elementslumen add Calendar --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 |
|---|---|---|---|---|---|---|
| 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 | 10 |
View Calendar code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. Before copying an example, complete the matching framework setup; React and Elements use their own behavior APIs.Width controls resize the preview container. Resize your browser to test viewport breakpoints.---
import { Calendar } from '@santi020k/lumen-astro'
---
<div class="docs-glass-demo">
<Calendar aria-label="July 2026" glass>
<strong>July 2026</strong>
<table>
<thead>
<tr><th>Mo</th><th>Tu</th><th>We</th><th>Th</th><th>Fr</th><th>Sa</th><th>Su</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td></tr>
<tr><td>8</td><td>9</td><td>10</td><td>11</td><td>12</td><td>13</td><td>14</td></tr>
<tr><td>15</td><td>16</td><td>17</td><td>18</td><td>19</td><td>20</td><td>21</td></tr>
</tbody>
</table>
</Calendar>
</div>import { Calendar } from '@santi020k/lumen-react'
export const Example = () => (
<>
<div className="docs-glass-demo">
<Calendar aria-label="July 2026" glass>
<strong>July 2026</strong>
<table>
<thead>
<tr><th>Mo</th><th>Tu</th><th>We</th><th>Th</th><th>Fr</th><th>Sa</th><th>Su</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td></tr>
<tr><td>8</td><td>9</td><td>10</td><td>11</td><td>12</td><td>13</td><td>14</td></tr>
<tr><td>15</td><td>16</td><td>17</td><td>18</td><td>19</td><td>20</td><td>21</td></tr>
</tbody>
</table>
</Calendar>
</div>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<div class="docs-glass-demo">
<lumen-calendar aria-label="July 2026" glass>
<strong>July 2026</strong>
<table>
<thead>
<tr><th>Mo</th><th>Tu</th><th>We</th><th>Th</th><th>Fr</th><th>Sa</th><th>Su</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td></tr>
<tr><td>8</td><td>9</td><td>10</td><td>11</td><td>12</td><td>13</td><td>14</td></tr>
<tr><td>15</td><td>16</td><td>17</td><td>18</td><td>19</td><td>20</td><td>21</td></tr>
</tbody>
</table>
</lumen-calendar>
</div>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.
| 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. |
| disabled | boolean | false | Disables month navigation, date selection, and the hidden form input. |
| max | YYYY-MM-DD string | - | Disables dates after the inclusive maximum date. |
| min | YYYY-MM-DD string | - | Disables dates before the inclusive minimum date. |
| month | YYYY-MM string | current or selected month | Sets the initially visible month. |
| name | string | - | Sets the name of the hidden input that stores the selected ISO date. |
| value | YYYY-MM-DD string | "" | Sets the selected date and hidden input value. |
| 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. |
Customize Calendar
Start with semantic theme tokens and a class on the public component. Keep its accessible name, focus treatment, and interaction state intact.
.product-calendar {
--surface: 0 0% 100%;
--ink: 220 20% 15%;
--line: 220 15% 82%;
}Apply product-calendar through Astro's class, React's className, or the custom element's class. Verify foreground and background contrast in both schemes.
| Hook | Values | Default | Contract |
|---|---|---|---|
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
Use the documented hooks above and adapter types when targeting component states. Theme guide · Accessibility verification scope
Keyboard interactions
Keyboard behavior provided by the Astro UIPrimitives runtime for this component.
| Key | Action |
|---|---|
| Enter, Space on a day | Select the focused day, update the hidden input, and dispatch native input and change events from that input. |
| ArrowRight, ArrowLeft | Move day focus by one day. |
| ArrowDown, ArrowUp | Move day focus by one week. |
| Home, End | Move focus to the first or last day in the current week row. |
| PageDown, PageUp | Move focus to the same date in the next or previous month. |