@reactloom/scheduler
v1.3.0
Published
Accessible React event calendar and Gantt chart for ReactLoom: month, week, day and agenda views, keyboard creation and moving of events, drag and drop, and explicit time zones.
Maintainers
Readme
@reactloom/scheduler
Accessible scheduling for ReactLoom: an EventCalendar (month, week, day, agenda and resource
timeline views) and a Gantt chart. Both are keyboard-first WAI-ARIA grids with explicit time
zones.
pnpm add @reactloom/scheduler @reactloom/ui @reactloom/themeimport '@reactloom/scheduler/styles.css';
import { EventCalendar, type CalendarEvent } from '@reactloom/scheduler';
const [events, setEvents] = useState<CalendarEvent[]>(initialEvents);
<EventCalendar
aria-label="Team calendar"
events={events}
defaultView="week"
timeZone="Europe/London"
onCreate={(range) => setEvents((all) => [...all, { id: crypto.randomUUID(), title: 'New event', ...range }])}
onEventChange={({ event, start, end }) =>
setEvents((all) => all.map((e) => (e.id === event.id ? { ...e, start, end } : e)))
}
/>;- Keyboard: arrows move between days and time slots; Enter on an empty slot creates an event;
Alt + arrows move an event and Alt + Shift + arrows resize it. Pointer drag and resize handles
call the same
onEventChange. - Repeating events: give an event a
recurrencerule (daily, weekly, monthly or yearly, withinterval,weekdays,count,untiland exceptions).parseRRuleandformatRRuleconvert to and from iCalendarRRULEtext;expandEventslists occurrences in a range. - Resources: pass
resourcesfor a column per person or room in the day view, and a row each in thetimelineview. - Gantt:
<Gantt aria-label="Plan" tasks={tasks} timeZone="UTC" />shows tasks, milestones, progress and dependency arrows as a navigable tree grid. AddonTaskChangeto make it editable.
The component never changes your data: it reports requested changes and you apply them.
Documentation and live examples: https://www.reactloom.dev/components/event-calendar · https://www.reactloom.dev/components/gantt
