Command Palette

Search for a command to run...

Docs
Calendar With Presets

Calendar With Presets

A customizable calendar component with preset date ranges and flexible styling options

Loading...

Installation

Usage

import { Calendar } from "@/components/ruixen/calendar-with-presets";
import { useState } from "react";
import { DateRange } from "react-day-picker";
 
export default function App() {
  const [date, setDate] = useState<DateRange | undefined>();
 
  return (
    <Calendar
      mode="range"
      selected={date}
      onSelect={setDate}
      className="rounded-md border"
    />
  );
}

Props

All props from react-day-picker are supported, plus:

PropTypeDefaultDescription
classNamestring-Additional CSS classes
classNamesobject-Custom class names for calendar parts
showOutsideDaysbooleantrueShow days outside current month
componentsobject-Custom component overrides

Features

  • Preset Ranges: Quick selection of common date ranges
  • Sidebar Navigation: Easy access to preset options
  • Range Selection: Select date ranges with visual feedback
  • Custom Styling: Highly customizable with Tailwind CSS
  • Responsive Design: Works on all screen sizes
  • Accessibility: Full keyboard and screen reader support