# Current month button

> Current month button

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-calendar-11).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-calendar-11
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-calendar-11-light-550d28b60fb18ce8.png
- Registry item: https://reui.io/r/new-york-v4/c-calendar-11.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-calendar-11.json
```

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

## Dependencies

- npm packages: `date-fns`
- Registry items: `button`, `calendar`, `card`

## Files

### `c-calendar-11.tsx`

```tsx
"use client"

import { useState } from "react"
import { addDays } from "date-fns"

import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import { Card, CardContent } from "@/components/ui/card"

export function Pattern() {
  const today = new Date()
  const selectedDay = addDays(today, -28)
  const [month, setMonth] = useState(selectedDay)
  const [date, setDate] = useState<Date | undefined>(selectedDay)

  return (
    <Card className="p-0">
      <CardContent className="p-0">
        <Calendar
          mode="single"
          month={month}
          onMonthChange={setMonth}
          onSelect={setDate}
          selected={date}
        />
        <Button
          className="mb-2 ml-4"
          onClick={() => setMonth(today)}
          size="sm"
          variant="outline"
        >
          Current month
        </Button>
      </CardContent>
    </Card>
  )
}
```
