fma-ds

Event Calendar

A headless-first event calendar: month, week, day, N-day, agenda and resource views, with recurring events, time zones and drag and drop.

Overview

  • Recurrence: structured rules or RRULE strings.
  • Drag and drop: drag to move, resize and create; keyboard users create through showDayAddButton's per-day buttons.
  • i18n: with RTL support.
  • State: a subscribable store (useEventCalendar, useEventCalendarSelector).

Compose <EventCalendar> with EventCalendarNav and EventCalendarContent, or build your own parts from the hooks. Events are controlled (events/onEventsChange) or not (defaultEvents); onEventUpdate accepts, rejects or adjusts each drag.

The nav, view switcher, date picker and "+N more" popover use the registry's react-aria Button, Tooltip, DropdownMenu, Popover and Calendar.

Installation

  1. 1

    Register the @fma-ds namespace in components.json (once)

    components.json
    {  "registries": {    "@fma-ds": "https://ds.fmartinsandre.dev.br/r/{name}.json"  }}
  2. 2

    Add the item

    pnpm dlx shadcn@latest add @fma-ds/event-calendar

    Files land in components/fma-ds/event-calendar/event-calendar-agenda-view.tsx and 13 more; npm and registry dependencies are installed along with them.

Dependencies

npm
cn@^0.5.0lucide-react@^1.61.0react-aria-components@^1.22.1@internationalized/date@^3.12.4