Calendar Web Component
A month grid for picking a date. Keyboard friendly, and it works inside a form.
How it helpsOne element, no markup inside. Arrow keys move by day and week, the buttons change month, and
change fires with an ISO date. Weeks start on Monday.Date picker
export default function Example() {
return (
<>
<sd-calendar name="date" value="2026-11-18"></sd-calendar>
</>
);
}<sd-calendar name="date" value="2026-11-18"></sd-calendar>With a range limit
export default function Example() {
return (
<>
<sd-calendar min="2026-11-10" max="2026-11-25" value="2026-11-18"></sd-calendar>
</>
);
}<sd-calendar min="2026-11-10" max="2026-11-25" value="2026-11-18"></sd-calendar>In Next.js
"use client";
import { useRef } from "react";
import { useSidedishEvent } from "sidedish";
export function DatePick() {
const ref = useRef<HTMLElement>(null);
useSidedishEvent<{ value: string }>(ref, "change", (e) => console.log(e.detail.value)); // "2026-11-18"
return <sd-calendar ref={ref} name="date" />;
}API
| Name | Type | Description |
|---|---|---|
value | attr / prop | Selected date, YYYY-MM-DD. |
min / max | attr | Earliest and latest selectable date. |
name | attr | Submits the value with a form. |
change | event | detail: { value } |