# V calendar 7

> Multiple Selection

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/v-calendar-7).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/v-calendar-7
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/v-calendar-7-light-5c2444ddcc625ef4.png
- Registry item: https://ui.cnippet.dev/r/v-calendar-7.json
- Categories: calendar
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-calendar-7.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: `@cnippet/calendar`

## Files

### `registry/default/variants/v-calendar-7.tsx`

```tsx
"use client";

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

export default function Particle() {
  const [dates, setDates] = React.useState<Date[] | undefined>([]);

  const sorted = [...(dates ?? [])].sort((a, b) => a.getTime() - b.getTime());

  return (
    <div className="flex flex-col gap-4">
      <Calendar mode="multiple" onSelect={setDates} selected={dates} />
      <div className="min-h-12 rounded-lg border border-dashed px-4 py-3">
        {sorted.length > 0 ? (
          <div className="flex flex-col gap-2">
            <p className="font-medium text-muted-foreground text-xs">
              {sorted.length} date{sorted.length !== 1 ? "s" : ""} selected
            </p>
            <ul className="flex flex-wrap gap-1.5">
              {sorted.map((d) => (
                <li
                  className="rounded-md bg-secondary px-2 py-0.5 font-medium text-xs"
                  key={d.toISOString()}
                >
                  {d.toLocaleDateString("en-US", {
                    day: "numeric",
                    month: "short",
                  })}
                </li>
              ))}
            </ul>
          </div>
        ) : (
          <p className="text-muted-foreground text-sm">
            Click any day to select multiple dates.
          </p>
        )}
      </div>
    </div>
  );
}
```
