Skip to main content

Calendar

A full-featured calendar component with month navigation, date selection, min/max constraints, disabled dates, today highlighting, and 3 size variants. Built with Framer Motion for smooth interactions.

Live Preview

Interact with the calendar component. Click a date to select it and see the selected value update in real time.

August 2026
Su
Mo
Tu
We
Th
Fr
Sa

Selected: None

tsx
1<AidashCalendar2selected={selected}3onSelect={setSelected}4month={month}5onMonthChange={setMonth}6/>

Installation

Install the Aidash Components package using your preferred package manager.

$ pnpm add @aidash/components

Import

Import the AidashCalendar component into your project.

tsx
tsx
import { AidashCalendar } from '@/components/aidash/calendar';

Basic Usage

A simple calendar with date selection and month navigation.

August 2026
Su
Mo
Tu
We
Th
Fr
Sa
tsx
tsx
const [selected, setSelected] = useState<Date | null>(null);
const [month, setMonth] = useState(new Date());

<AidashCalendar
selected={selected}
onSelect={setSelected}
month={month}
onMonthChange={setMonth}
/>

Sizes

The calendar comes in three sizes: sm, md, and lg to fit different layouts.

size="sm"

August 2026
Su
Mo
Tu
We
Th
Fr
Sa

size="md"

August 2026
Su
Mo
Tu
We
Th
Fr
Sa

size="lg"

August 2026
Su
Mo
Tu
We
Th
Fr
Sa
tsx
tsx
<AidashCalendar size="sm" ... />
<AidashCalendar size="md" ... />
<AidashCalendar size="lg" ... />

Min / Max Date

Restrict selectable dates to a specific range. Dates outside the range are grayed out and unclickable.

August 2026
Su
Mo
Tu
We
Th
Fr
Sa

Range: 7/28/20268/16/2026

tsx
tsx
<AidashCalendar
selected={selected}
onSelect={setSelected}
month={month}
onMonthChange={setMonth}
minDate={new Date(2026, 6, 4)}
maxDate={new Date(2026, 6, 23)}
/>

Disabled Dates

Disable specific individual dates. Useful for blocking holidays, booked dates, or unavailable slots.

August 2026
Su
Mo
Tu
We
Th
Fr
Sa

Disabled: 10th, 15th, 20th, 25th of this month

tsx
tsx
const disabledDates = [
new Date(2026, 6, 10),
new Date(2026, 6, 15),
new Date(2026, 6, 20),
new Date(2026, 6, 25),
];

<AidashCalendar
disabledDates={disabledDates}
...
/>

Today Highlight

Today's date is automatically highlighted with a subtle brand accent, making it easy to identify the current day at a glance.

August 2026
Su
Mo
Tu
We
Th
Fr
Sa

Today (8/2/2026) is highlighted automatically

Controlled Month

Use the month and onMonthChange props to control which month is displayed externally.

August 2026
Su
Mo
Tu
We
Th
Fr
Sa
tsx
tsx
const [month, setMonth] = useState(new Date());

<button onClick={() => setMonth(new Date())}>Today</button>

<AidashCalendar
month={month}
onMonthChange={setMonth}
selected={selected}
onSelect={setSelected}
/>

Props API

Complete list of props supported by the AidashCalendar component.

PropTypeDefaultDescription
selectedDate | nullnullThe currently selected date
onSelect(date: Date) => voidCallback when a date is clicked
monthDateControlled month to display (first day of month)
onMonthChange(date: Date) => voidCallback when month navigation occurs
minDateDateEarliest selectable date
maxDateDateLatest selectable date
disabledDatesDate[][]Array of specific dates to disable
size'sm' | 'md' | 'lg''md'Size of the calendar
classNamestring''Additional CSS classes

Accessibility

Built-in accessibility features for keyboard navigation and screen readers.

  • Uses role="grid" on the calendar container for proper ARIA grid semantics.
  • Each day cell uses role="gridcell" with aria-selected and aria-disabled attributes.
  • Navigation buttons include aria-label for "Previous month" and "Next month".
  • Disabled dates have disabled attribute set, preventing focus and interaction.
  • All interactive elements are native <button> elements, ensuring keyboard focusability and Enter/Space activation.
  • Visual states (selected, today, disabled) use sufficient color contrast and do not rely solely on color to convey meaning.

Components that work well alongside the Calendar.