Calendar

A React calendar for single dates, ranges, and multiple dates, with month and year quick pickers, booked dates, event dots, and full keyboard control.

Loading preview

Examples

Practical examples and common states for the same installable component.

Range

Selects a continuous range of dates.

examples/calendar-range.tsx
import { Calendar, type DateRange } from "@/components/wensity/calendar";
import { useState } from "react";
export function CalendarRange() {
const [range, setRange] = useState<DateRange | undefined>();
return <Calendar mode="range" selected={range} onSelect={setRange} />;
}

Multiple

Selects multiple independent dates.

examples/calendar-multiple.tsx
import { Calendar } from "@/components/wensity/calendar";
import { useState } from "react";
export function CalendarMultiple() {
const [selected, setSelected] = useState<Date[]>([]);
return <Calendar mode="multiple" selected={selected} onSelect={setSelected} />;
}

Month Year

Fast month and year navigation.

examples/calendar-month-year.tsx
import { Calendar } from "@/components/wensity/calendar";
import { useState } from "react";
export function CalendarMonthYear() {
const [month, setMonth] = useState(new Date());
return <Calendar month={month} onMonthChange={setMonth} quickNav />;
}

Booked

Highlights unavailable and reserved dates.

examples/calendar-booked.tsx
import { Calendar } from "@/components/wensity/calendar";
import { useState } from "react";
export function CalendarBooked() {
const [selected, setSelected] = useState<Date | undefined>();
const bookedDates = [
new Date(2026, 0, 12),
new Date(2026, 0, 13),
new Date(2026, 0, 18),
];
return <Calendar selected={selected} onSelect={setSelected} bookedDates={bookedDates} />;
}

Events

Displays indicators for scheduled dates.

examples/calendar-events.tsx
import { Calendar } from "@/components/wensity/calendar";
import { useState } from "react";
export function CalendarEvents() {
const [selected, setSelected] = useState<Date | undefined>();
const events = [
{ date: new Date(2026, 0, 9), label: "Design review" },
{ date: new Date(2026, 0, 14), label: "Team sync" },
];
return <Calendar selected={selected} onSelect={setSelected} events={events} />;
}

Overview

Calendar is a React and Tailwind CSS calendar component, in Next.js or any React app, written from scratch with no date library, for single dates, date ranges, and multiple dates. Clicking the month or year opens quick pickers, and the day grid follows the ARIA grid pattern: arrow keys move by day and week, Home and End jump within the week, and Page Up and Page Down change month. bookedDates cannot be picked, events add a dot under a day, and weekStartsOn switches to Monday. Month and weekday names are English, so translate them for other locales.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add calendar

Usage

Import Calendar from @/components/wensity/calendar and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import { Calendar } from "@/components/wensity/calendar";
import { useState } from "react";
export default function Example() {
const [selected, setSelected] = useState<Date | undefined>(new Date());
return <Calendar selected={selected} onSelect={setSelected} />;
}

Props

PropTypeDefaultDescription
mode"single" | "range" | "multiple""single"Selection model. Changes the shape of selected and onSelect.
selectedDate | Date[] | DateRange-Controlled selection. Type follows mode.
defaultSelectedDate | Date[] | DateRange-Initial selection when uncontrolled.
onSelect(value: Date | Date[] | DateRange | undefined) => void-Called when the selection changes. Argument follows mode.
monthDate-Controlled displayed month.
defaultMonthDate-Initial displayed month. Defaults to the current month.
onMonthChange(month: Date) => void-Called when the displayed month changes.
weekStartsOn0 | 10First day of the week. 0 is Sunday, 1 is Monday.
disabled(date: Date) => boolean-Return true to block a date from selection.
bookedDatesDate[]-Unavailable dates, shown struck through and disabled.
eventsCalendarEvent[]-Dates that carry a scheduled-event indicator dot.
quickNavbooleantrueEnables the fast month and year jump view from the header.
  • GitHub-Style Activity Grid component preview

    GitHub-Style Activity Grid

    365 squares sharing one tooltip that flies between days on rails, with a reveal that ripples backward from today.

  • Split-Flap Display component preview

    Split-Flap Display

    A ceramic and graphite split-flap device that ripples each flap into your message.

  • Multi-Step Form Wizard component preview

    Multi-Step Form Wizard

    A multi-step form wizard whose card physically reshapes to wrap each new step as the content slides in behind it.

  • Bento Grid Layout component preview

    Bento Grid Layout

    A responsive bento grid of dashboard tiles where clicking one moves it to the front and the rest glide into place.