# Date Picker

> Popover date picker that combines Button, Calendar, and Popover.

Registry name: `date-picker`. HTML docs: https://ui.anuragroy.dev/component/date-picker.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/date-picker.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/date-picker.json`.

Registry JSON: https://ui.anuragroy.dev/r/date-picker.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/date-picker.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

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

## Usage

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

export function Example() {
  return <DatePicker />
}
```

## API

### DatePicker

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | Date | — |  |
| `defaultValue` | Date | — |  |
| `onValueChange` | (date: Date \| undefined) => void | — |  |
| `placeholder` | string | "Pick a date" |  |
| `disabled` | boolean | — |  |
| `dateFormat` | string | "PPP" | date-fns format string. |

## See also

- [HTML page](https://ui.anuragroy.dev/component/date-picker): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/date-picker.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
