Components

Calendar

A date selection calendar widget for picking single dates or date ranges.

Installation

npm install @marmoui/ui
yarn add @marmoui/ui
pnpm add @marmoui/ui
bun add @marmoui/ui

Usage

import { Calendar } from '@marmoui/ui';

Examples

Basic Calendar

Default

Month view calendar

July 2026
<Calendar mode="single" />

With Pre-Selected Date

Selected Date

Calendar with a default selected date

July 2026
function CalendarWithSelection() {
const [date, setDate] = React.useState<Date | undefined>(new Date());

return (
  <Calendar
    mode="single"
    selected={date}
    onSelect={setDate}
  />
);
}

Date Range Selection

Range Selection

Select a start and end date for date ranges

July 2026
August 2026
function CalendarRange() {
const [range, setRange] = React.useState<DateRange | undefined>({
  from: new Date(2026, 2, 10),
  to: new Date(2026, 2, 18),
});

return (
  <Calendar
    mode="range"
    selected={range}
    onSelect={setRange}
    numberOfMonths={2}
  />
);
}

Disabled Dates

Disabled Dates

Disable past dates or specific date ranges

July 2026
<Calendar
mode="single"
disabled={{ before: new Date() }}
/>

Multiple Months

Two Months

Display two months side by side

July 2026
August 2026
<Calendar
mode="single"
numberOfMonths={2}
/>

Best Practices

Show today's date

Highlight the current date for orientation.

Disable unavailable dates

Grey out dates that can't be selected (past dates, booked dates).

Don't use without context

Pair the calendar with a label or field that explains what date is being selected.

Don't allow invalid ranges

Enforce start-before-end logic for range selection.

Props

Props

Accessibility

  • Full keyboard navigation: Arrow keys move between days, Page Up/Down changes months.
  • Selected date is announced by screen readers.
  • Disabled dates are communicated via aria-disabled.
  • Uses role="grid" with proper cell and header roles.