Calendar

A clean, minimal, and highly interactive calendar component built with Framer Motion. It provides full control over date selection, highlighting, and filtering, making it perfect for bookings, event scheduling, or date picking with a premium feel.

uiframer-motionlucide-react

Installation

$npx futureuikit add calendar

Import

import { Calendar } from "@/components/ui/calendar"
Layout Variant
Color Theme
Theme
Shape
Spacing
Shadow
Future Dates

Named Keys & Props

Pass these exact named keys as props on <Calendar />. Click any color pill to copy the prop.

colorDefault is "default"(Black & White)
variantVisual style
"solid""outline""ghost""link"
themeSurface theme
"default""modern""clean""futuristic""brutal""halftone"
shapeCorner shape
"default""square""rounded""sharp"
spacingInner spacing
"default""2x""4x""6x""8x"

Usage Example

A basic implementation example to get you started.

Example Implementation
import { Calendar } from"@/components/ui/calendar";
import { CalendarSyncProvider } from"@/components/internal/calendar-context";
import { useState } from"react";

export default function Example() {
 const [date, setDate] = useState(new Date());
 
 const highlighted = [
 new Date(2025, 4, 15),
 new Date(2025, 4, 20),
 ];

 const filterDate = (d) => d.getDay() !== 0 && d.getDay() !== 6;

 return (
 <CalendarSyncProvider>
 <Calendar 
 value={date}
 onChange={setDate}
 highlightedDates={highlighted}
 filterDate={filterDate}
 variant="solid"
 theme="modern"
 color="default"
 syncGroup="booking"
 allowFutureDates={false}
 yearRange={{ start: 1950 }}
 />
 </CalendarSyncProvider>
 );
}

Features

Key capabilities and highlights.

Key Capabilities
  • ◆Smooth month/year transitions with spring-based animations.
  • ◆Support for multiple variants: Modern (Glass), Clean (Solid), and Minimal.
  • ◆Highly customizable: easily highlight specific dates, disable others, or hide them entirely.
  • ◆Custom date filtering logic via the'filterDate'prop.
  • ◆Interactive hover and tap effects for a responsive user experience.
  • ◆Dependency-free (uses native Date object) and fully responsive.

Notes

Important implementation details to consider.

Implementation Details
  • ◆Install: Run 'npx futureuikit add calendar' to get the component and motion configurations.
  • ◆Import: 'import { Calendar } from "@/components/ui/calendar";'
  • ◆State Management: Pass 'value' (Date) and 'onChange' (function) to track selection.
  • ◆Superpower: Use 'highlightedDates' (Date[]) and 'onHighlightToggle' to allow interactive date tagging/favoriting.
  • ◆Variants & Themes: Pass 'variant' ('solid', 'outline', 'ghost', 'link'), 'theme' ('default', 'modern', 'clean', 'futuristic', 'brutal', 'halftone'), and any of the 10 named 'color' keys.
  • ◆Restrictions: Use 'filterDate' (fn: Date => boolean) to programmatically disable dates (like weekends or past dates).
  • ◆Modes: Set 'mode' to 'picker' (default), 'display' (read-only with highlighted dates), or 'filter' (multi-select toggle).
  • ◆Cross-page sync: Wrap your app in '<CalendarSyncProvider>' and give calendars the same 'syncGroup' to share dates across pages.
  • ◆API highlights: Pass dates via 'apiHighlightedDates' (Date[]) to show external/API data as highlighted on the calendar.
  • ◆Future dates: By default future dates are disabled. Set 'allowFutureDates={true}' to enable selection of future dates.
  • ◆Year range: Use 'yearRange={{ start: 1950, end: 2030 }}' to customize the year selection range. Defaults to 1950 – current year.