VayuUI

BigCalendar

A full-featured calendar with month, week, and day views.

Installation

npx vayu-ui-cli@latest add bigcalendar

Usage

Big Calendar Example
Sun
Mon
Tue
Wed
Thu
Fri
Sat
<BigCalendar
  events={events}
  defaultView="month"
  onEventClick={(e) => console.log(e)}
  onDateClick={(d) => console.log(d)}
/>

Anatomy

<BigCalendar events={events} defaultView="month">
  <BigCalendar.Toolbar />
  <BigCalendar.MonthView />
  <BigCalendar.WeekView />
  <BigCalendar.DayView />
  <BigCalendar.Event event={event} />
</BigCalendar>
  • BigCalendar — Root container. Manages date, view state, and provides context to all subcomponents.
  • BigCalendar.Toolbar — Navigation bar with Today/Prev/Next buttons and view switcher (Month/Week/Day).
  • BigCalendar.MonthView — Monthly grid displaying days and events with overflow indicators.
  • BigCalendar.WeekView — Time-grid view showing hourly slots across a seven-day column layout.
  • BigCalendar.DayView — Single-day time grid with hourly slots and all-day event section.
  • BigCalendar.Event — Individual event card with optional remove button and color coding.

Accessibility

Keyboard Support

KeyViewAction
ArrowLeftMonthMove focus to the previous day.
ArrowRightMonthMove focus to the next day.
ArrowUpMonthMove focus to the day one row above.
ArrowDownMonthMove focus to the day one row below.
ArrowLeftWeekMove focus to the previous column (day).
ArrowRightWeekMove focus to the next column (day).
ArrowUpWeekMove focus to the previous hour slot.
ArrowDownWeekMove focus to the next hour slot.
ArrowUpDayMove focus to the previous hour slot.
ArrowDownDayMove focus to the next hour slot.
Enter / SpaceAllSelect the focused cell (triggers onDateClick and switches to day view in Month).
Enter / SpaceEventActivate the focused event (triggers onEventClick).

ARIA Attributes

ElementRoleARIA Attributes
Rootapplicationaria-label="Calendar"
Toolbartoolbararia-label="Calendar navigation"
Navigation buttonsgrouparia-label="Previous period" / aria-label="Next period"
Title displayaria-live="polite"
View switcherradiogrouparia-label="Calendar view"
View buttonradioaria-checked={active}
Month gridgridaria-label="January 2026"
Day headerscolumnheaderaria-label={fullDayName}
Day cellsgridcellaria-label="Monday, January 6, 2026", aria-selected for today
Week gridgridaria-label="Week of Monday, January 6, 2026"
Time labelsrowheaderHour label text
Week/Day cellsgridcellaria-label="Monday, January 6, 2026 at 9:00 AM"
Eventbuttonaria-label="{title}, all day"
Remove buttonaria-label="Remove {title}"
Overflow indicatoraria-label="3 more events"

Focus Behavior

  • The first interactive cell in each view has tabIndex={0}; all other cells have tabIndex={-1}.
  • Arrow key navigation moves focus between cells using roving tabindex.
  • All toolbar buttons and events have visible focus-visible:ring-2 focus-visible:ring-focus indicators.
  • The view switcher uses focus-visible:z-10 to ensure focus rings render above siblings.

Screen reader behavior

When the calendar loads, screen readers announce the root as an application landmark labeled "Calendar". The toolbar announces as a toolbar region with navigation buttons. The current date and view title are announced via aria-live="polite" whenever the user navigates between periods or switches views. In the month view, day cells are announced with their full formatted date (e.g., "Monday, January 6, 2026"). In week and day views, time slots are announced with both date and hour (e.g., "Monday, January 6, 2026 at 9:00 AM"). Events are announced as buttons with their title and all-day status. The view switcher is announced as a radio group, allowing users to switch between Month, Week, and Day views with standard radio button semantics.

Component Folder Structure

BigCalendar/
├── BigCalendar.tsx          # Root component with context provider and state management
├── BigCalendarToolbar.tsx   # Navigation toolbar with Today/Prev/Next and view switcher
├── BigCalendarMonthView.tsx # Monthly grid view with day cells and event indicators
├── BigCalendarWeekView.tsx  # Seven-day time grid with hourly slots
├── BigCalendarDayView.tsx   # Single-day time grid with all-day section
├── BigCalendarEvent.tsx     # Event card with color coding and remove action
├── hooks.ts                 # CalendarContext and useCalendar hook
├── types.ts                 # TypeScript type definitions
├── utils.ts                 # Date helpers, formatting, and color utilities
├── index.ts                 # Re-exports all components and types
└── README.md                # Component usage reference

Props

BigCalendar

PropTypeDefaultDescription
eventsCalendarEvent[][]Events to display.
defaultDateDatenew Date()Initial date for uncontrolled usage.
dateDateControlled current date.
defaultView'month' | 'week' | 'day''month'Initial view for uncontrolled usage.
view'month' | 'week' | 'day'Controlled active view.
onDateChange(date: Date) => voidCalled when the navigated date changes.
onViewChange(view: CalendarView) => voidCalled when the active view changes.
onEventClick(event: CalendarEvent) => voidCalled when an event is clicked.
onDateClick(date: Date) => voidCalled when a date cell or time slot is clicked.
onEventRemove(event: CalendarEvent) => voidCalled when an event remove button is clicked.
weekStartsOn0 | 10First day of the week. 0 = Sunday, 1 = Monday.
renderEvent(event: CalendarEvent) => ReactNodeCustom render function for event cards.
classNamestringAdditional CSS classes for the root element.

BigCalendar.Event

PropTypeDefaultDescription
eventCalendarEventThe event data to display.
showRemovebooleanfalseShow a remove button on the event card.
heightnumberPixel height for timed events in week/day views.
variant'compact' | 'default''default'Display variant for the event card.

CalendarEvent

FieldTypeRequiredDescription
idstring | numberYesUnique identifier.
titlestringYesEvent title.
startDateYesStart date and time.
endDateYesEnd date and time.
colorstringNoColor theme: blue, green, red, amber, purple, pink, primary.
allDaybooleanNoMarks the event as all-day.
descriptionstringNoOptional event description.

On this page