---
title: "Date Picker"
description: "Date Picker component - native date inputs with calendar popover."
slug: "date-picker"
---

import { DocPage, PageHeader, SkillPanel, SourceFiles, SourceNote, StatesSection, CodeBlock, Demo, DemoCode, ChangelogEntries, ArchBody, StatsClaim, StatsCards, PageOverlay, DocText, DocLink, H2, SkillField, SkillText, SkillRow, SkillGrid, Variant, ApiPill, Dim, CodeCard, TableCard } from "../../lib/components/index";

<DocPage meta={meta}>

<PageHeader slug="date-picker" title="Date Picker" component="date-picker">
  A date selection input. Built on native <code>&lt;input type="date"&gt;</code> and <code>&lt;input type="datetime-local"&gt;</code> - the browser provides the calendar UI.
</PageHeader>

<SkillPanel component="date-picker">
  <SkillField label="Native basis">
<SkillText><code>&lt;input type="date"&gt;</code> element with native browser date picker.</SkillText>
  </SkillField>

  <SkillField label="Web Platform APIs">
<SkillRow>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date" title="native date picker with calendar UI"><code>&lt;input type="date"&gt;</code></ApiPill>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local" title="date and time picker"><code>&lt;input type="datetime-local"&gt;</code></ApiPill>
  </SkillRow>
  </SkillField>

  <SkillField label="Classes">
<SkillRow>
    <code>.input</code>
    <code>.date-input</code>
  </SkillRow>
  </SkillField>

  <SkillField label="Notes">
<SkillText dense>• Reuses the <code>.input</code> class - the native date picker provides the calendar UI.</SkillText>
  <SkillText dense>• No custom calendar implementation needed - the browser handles it.</SkillText>
  <SkillText dense>• The calendar popup is rendered by the OS/browser and cannot be styled.</SkillText>
  <p class="text-muted-foreground m-0">• For a fully custom date picker, a custom calendar component would be needed.</p>
  </SkillField>
</SkillPanel>

```html example label="Date" hint="Native date picker."
<input class="date-input" type="date" id="birthday" />
```

```html example label="Date and time"
<input class="date-input" type="datetime-local" id="meeting" />
```

```html example label="With constraints" hint="min / max hold for the calendar AND for typing: type 15 May 2030 into either field and leave it - the browser marks it out of range (:user-invalid), the border turns destructive and the .date-input-hint below states the allowed range with a warning sign. The hint is always there (aria-describedby), so the range is known before anyone types. The second field shows the invalid look directly (aria-invalid, as an app would flag a server-side error)."
<div class="grid grid-cols-auto gap-4" style="--layout-min: 14rem">
  <div>
    <label class="label" for="d-out">Outbound</label>
    <input
      class="date-input"
      type="date"
      id="d-out"
      value="2026-03-10"
      min="2024-01-01"
      max="2026-12-31"
      aria-describedby="d-out-hint"
    />
    <p class="date-input-hint" id="d-out-hint">Between 1 Jan 2024 and 31 Dec 2026.</p>
  </div>
  <div>
    <label class="label" for="d-back">Return</label>
    <input
      class="date-input"
      type="date"
      id="d-back"
      value="2030-05-15"
      min="2024-01-01"
      max="2026-12-31"
      aria-invalid="true"
      aria-describedby="d-back-hint"
    />
    <p class="date-input-hint" id="d-back-hint">Between 1 Jan 2024 and 31 Dec 2026.</p>
  </div>
</div>
```

```html example label="Sizes" hint="Same ladder as .input via data-size - md is 2.25rem, so date fields row-align with text inputs."
<div class="flex items-center gap-4 mb-3">
  <span class="demo-label demo-label-w5">Extra small</span>
  <input
    class="date-input flex-1"
    type="date"
    value="2026-09-12"
    data-size="xs"
    aria-label="Date xs"
    style="max-width: 12rem"
  />
</div>
<div class="flex items-center gap-4 mb-3">
  <span class="demo-label demo-label-w5">Small</span>
  <input
    class="date-input flex-1"
    type="date"
    value="2026-09-12"
    data-size="sm"
    aria-label="Date sm"
    style="max-width: 12rem"
  />
</div>
<div class="flex items-center gap-4 mb-3">
  <span class="demo-label demo-label-w5">Medium</span>
  <input
    class="date-input flex-1"
    type="date"
    value="2026-09-12"
    data-size="md"
    aria-label="Date md"
    style="max-width: 12rem"
  />
</div>
<div class="flex items-center gap-4 mb-3">
  <span class="demo-label demo-label-w5">Large</span>
  <input
    class="date-input flex-1"
    type="date"
    value="2026-09-12"
    data-size="lg"
    aria-label="Date lg"
    style="max-width: 12rem"
  />
</div>
<div class="flex items-center gap-4 mb-3">
  <span class="demo-label demo-label-w5">Extra large</span>
  <input
    class="date-input flex-1"
    type="date"
    value="2026-09-12"
    data-size="xl"
    aria-label="Date xl"
    style="max-width: 12rem"
  />
</div>
```

<StatesSection>
  <p class="text-sm text-muted-foreground">Machine contract - verified against <a class="link" href="../schemas/date-picker.schema.json"><code>date-picker.schema.json</code></a> by <code>bun run verify</code>:</p>

```states
| State | Type | Values | Default | Description |
| --- | --- | --- | --- | --- |
| `value` | `string` | `—` | `""` | Selected date (`input.value`, ISO `YYYY-MM-DD`; empty = none). |
| `minDate` | `string` | `—` | `""` | Lower bound of the picked range (native `min` attribute, ISO `YYYY-MM-DD`; empty clears). |
| `maxDate` | `string` | `—` | `""` | Upper bound of the picked range (native `max` attribute). |
| `disabled` | `boolean` | `true`, `false` | `false` | Interaction off (native `disabled` attribute). |
```

</StatesSection>

<SourceFiles component="date-picker" section="css" />

</DocPage>
