# Use cases

> Calendar and date-range pickers with presets like today, last 7 days, this month. Copy these shadcn/ui patterns for filters and booking flows.

A shadcn/ui block from the [@shadcnuikit](https://shadcnuikit.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/shadcnuikit/date-picker-example1).

- Page, with a live preview: https://shadcn.exchange/r/shadcnuikit/date-picker-example1
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/shadcnuikit/date-picker-example1-light-d4c10375e95a74dc.png
- Registry item: https://shadcnuikit.com/r/date-picker-example1.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://shadcnuikit.com/r/date-picker-example1.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `calendar`

## Files

### `contents/examples/date-picker/use-cases/1/index.tsx`

```tsx
"use client";

import * as React from "react";
import { Calendar } from "@/components/ui/calendar";

export default function BasicDatePicker() {
  const [date, setDate] = React.useState<Date | undefined>(new Date());

  return (
    <div className="border rounded-lg">
      <Calendar mode="single" selected={date} onSelect={setDate} />
    </div>
  );
}
```
