Command Palette

Search for a command to run...

Docs
Dropdown Multi Calendar

Dropdown Multi Calendar

A multi-select calendar with year/month dropdowns and badge-based date display

Loading...

Installation

Usage

import { DropdownMultiCalendar } from "@/components/ruixen/dropdown-multi-calendar";
import { useState } from "react";
 
export default function App() {
  const [dates, setDates] = useState<Date[]>([]);
 
  return (
    <DropdownMultiCalendar
      selectedDates={dates}
      onChange={(newDates) => setDates(newDates)}
      minYear={2000}
      maxYear={2030}
      maxSelectable={10}
      label="Select your important dates"
      monthFormat="MMM"
      className="max-w-md"
    />
  );
}

Props

PropTypeDefaultDescription
selectedDatesDate[][]Currently selected dates
onChange(dates: Date[]) => void-Callback when selection changes
minYearnumber1900Minimum selectable year
maxYearnumbercurrent + 10Maximum selectable year
maxSelectablenumber-Maximum selectable dates
labelstring"Select Dates"Component title
monthFormatstring"MMMM"Month dropdown format
classNamestring-Container CSS classes
calendarClassNamestring-Calendar CSS classes
dropdownClassNamestring-Dropdown CSS classes

Features

  • Year/Month Dropdowns: Quick navigation to any month
  • Multi-Selection: Select multiple dates across months
  • Badge Display: Selected dates shown as removable badges
  • Selection Limits: Optional maximum date constraints
  • Sorted Display: Dates automatically sorted chronologically
  • Easy Navigation: Jump to any year/month combination

Month Format Options

// Full month name
monthFormat = "MMMM"; // January
 
// Short month name
monthFormat = "MMM"; // Jan
 
// Numeric month
monthFormat = "M"; // 1

Use Cases

  • Event Planning: Select multiple event dates
  • Availability Tracking: Mark available dates
  • Deadline Management: Set multiple project milestones
  • Holiday Planning: Choose vacation dates