<div class="demo-grid">
<ray-date-picker label="Release date" description="When the update goes out." value="2026-10-06"></ray-date-picker>
<ray-date-picker label="Deadline" placeholder="No deadline" min="2026-10-01" max="2026-12-31" format="long" clearable></ray-date-picker>
</div>
<div class="demo-row" style="margin-top: 1.5rem; align-items: flex-start">
<ray-calendar id="demo-calendar" value="2026-10-15" min="2026-10-05"></ray-calendar>
<span id="demo-calendar-out" style="color: var(--ray-muted-foreground); font-size: var(--ray-font-size-sm)">Pick a day.</span>
</div>
<div class="demo-caption" style="margin-top: 1.5rem">Full width: the days share the width of the container</div>
<ray-calendar full-width size="md" value="2026-10-15" class="demo-calendar-wide"></ray-calendar>
<script type="module">
document.getElementById("demo-calendar").addEventListener("change", (e) => {
document.getElementById("demo-calendar-out").textContent = `change: ${e.currentTarget.value}`;
});
</script>
import type { CSSProperties } from "react";
import { RayDatePicker, RayCalendar } from "@raylang/react";
export function DatePickerExample() {
return (
<>
<div className="demo-grid">
<RayDatePicker label="Release date" description="When the update goes out." value="2026-10-06" />
<RayDatePicker label="Deadline" placeholder="No deadline" min="2026-10-01" max="2026-12-31" format="long" clearable />
</div>
<div className="demo-row" style={{ marginTop: "1.5rem", alignItems: "flex-start" }}>
<RayCalendar id="demo-calendar" value="2026-10-15" min="2026-10-05" />
<span id="demo-calendar-out" style={{ color: "var(--ray-muted-foreground)", fontSize: "var(--ray-font-size-sm)" } as CSSProperties}>Pick a day.</span>
</div>
<div className="demo-caption" style={{ marginTop: "1.5rem" }}>Full width: the days share the width of the container</div>
<RayCalendar fullWidth size="md" value="2026-10-15" className="demo-calendar-wide" />
</>
);
}
<template>
<div class="demo-grid">
<RayDatePicker label="Release date" description="When the update goes out." value="2026-10-06" />
<RayDatePicker label="Deadline" placeholder="No deadline" min="2026-10-01" max="2026-12-31" format="long" clearable />
</div>
<div class="demo-row" style="margin-top: 1.5rem; align-items: flex-start">
<RayCalendar id="demo-calendar" value="2026-10-15" min="2026-10-05" />
<span id="demo-calendar-out" style="color: var(--ray-muted-foreground); font-size: var(--ray-font-size-sm)">Pick a day.</span>
</div>
<div class="demo-caption" style="margin-top: 1.5rem">Full width: the days share the width of the container</div>
<RayCalendar full-width size="md" value="2026-10-15" class="demo-calendar-wide" />
</template>