# Date Picker

Calendar date picker with keyboard navigation



<ComponentPreview base="ink" name="date-picker-demo" />

Installation [#installation]

<CodeTabs>
  <TabsList>
    <TabsTrigger value="cli">
      Command
    </TabsTrigger>

    <TabsTrigger value="manual">
      Manual
    </TabsTrigger>
  </TabsList>

  <TabsContent value="cli">
    ```bash
    npx shadcn@latest add @termcn/date-picker
    ```
  </TabsContent>

  <TabsContent value="manual">
    <Steps>
      <Step>
        Copy and paste the following code into your project.
      </Step>

      <ComponentSource base="ink" name="date-picker" title="components/ui/date-picker.tsx" />

      <Step>
        Update the import paths to match your project setup.
      </Step>
    </Steps>
  </TabsContent>
</CodeTabs>

Usage [#usage]

```tsx
import { DatePicker } from "@/components/ui/date-picker";
```

```tsx
<DatePicker
  label="Birth date"
  value={new Date(2026, 0, 15)}
  onChange={(date) => console.log("Selected:", date)}
  onSubmit={(date) => console.log("Submitted:", date)}
/>
```

API Reference [#api-reference]

DatePicker [#datepicker]

| Prop        | Type                   | Default |
| ----------- | ---------------------- | ------- |
| `value`     | `Date`                 | -       |
| `onChange`  | `(date: Date) => void` | -       |
| `onSubmit`  | `(date: Date) => void` | -       |
| `label`     | `string`               | -       |
| `minDate`   | `Date`                 | -       |
| `maxDate`   | `Date`                 | -       |
| `autoFocus` | `boolean`              | `false` |
| `id`        | `string`               | -       |
