This page is the complete reference for @birchui/scheduler. For full type signatures generated from the source, see the package API reference.
TypeScript
import { createScheduler, schedulerDefinition } from '@birchui/scheduler';import type { SchedulerApi, SchedulerEvent, SchedulerEvents, SchedulerOptions, SchedulerResource } from '@birchui/scheduler';
createScheduler(container, options) renders a scheduler into container and returns a SchedulerApi.
schedulerDefinition is the widget definition (name, tag name, factory and event list) that the framework adapters and the <birchui-scheduler> element are built from.
Both are generic: createScheduler<TEvent, TResource> types every payload and return value with your own event and resource interfaces.
The range the timeline covers, extended to whole ticks. An invalid start falls back to today, an invalid end to seven days after start, each with a console warning.
viewPreset
ViewPresetName | ViewPreset
Time scale: 'minuteAndHour', 'hourAndDay', 'dayAndWeek', 'dayAndMonth', 'weekAndMonth', 'monthAndYear', or a custom preset. Default: 'hourAndDay'.
zoomLevels
(ViewPresetName | ViewPreset)[]
The ladder used by zoomIn and zoomOut, from most detailed to coarsest. Default: all six built-in presets.
fillWidth
boolean
Widen ticks so a short range fills the available width. Ticks never get narrower than the preset's tickWidth. Default: true.
timeZone
string
IANA time zone for the whole timeline. Defaults to the browser's zone; an invalid identifier falls back to it with a warning. See Time zones.
locale
string
BCP 47 locale for header labels and accessible descriptions. Default: the browser's locale.
weekStartsOn
0 | 1 | 2 | 3 | 4 | 5 | 6
First day of the week for week ticks, 0 is Sunday. Weeks start on Monday by default.
workingTime
{ days, startHour, endHour } | null
Working hours and days; time outside them is shaded. See Working time.
weekendDays
number[]
Days to shade when workingTime is not set. Default: [0, 6].
Subscribe with on(event, listener), which returns an unsubscribe function. Every payload is a single object. A listener that throws never breaks the scheduler: the error is caught and reported with console.error, and the remaining listeners still run.
In the framework adapters the same events are on… props in React, Solid and Svelte (onEventDrop), kebab-case listeners in Vue (@event-drop), outputs in Angular ((eventDrop)) and kebab-case CustomEvents on <birchui-scheduler> (event-drop, payload in detail). See Using the Scheduler in your framework.
Event
Payload
When
ready
{ api }
Emitted once, in a microtask right after createScheduler returns, so a listener attached immediately still receives it.
eventClick
{ event, resource, domEvent }
An event bar was clicked, or Enter was pressed on it. Also selects the event.