Scheduler overviewScheduler
A resource timeline for planning people, crews, rooms and equipment, with drag and drop, resizing, drag-to-create, zoom presets, working time and time zones.
Birch UI Scheduler is a resource timeline. Resources (field technicians, installation crews, meeting rooms, vehicles) are listed down the left side, time runs left to right, and each event is a bar in its resource's row. Dispatchers drag jobs between people, stretch them to change the duration, and drag across empty time to book new work.
It is built on the same vanilla TypeScript engine as BirchUI Grid, so it has no framework dependency, renders only what is on screen in both directions, and follows the same widget contract as every other Birch UI component.
Loading demo…
View source
Sample data and small UI helpers are imported from the docs' demos/_shared.ts and demos/_scheduler-data.ts files.
import { createScheduler, type ViewPresetName } from '@birchui/scheduler';
import { docsTheme, field, layout, onDocsThemeChange, button } from './_shared';
import { WEEK_START, at, serviceJobs, technicians, type ServiceJob, type Technician } from './_scheduler-data';
export const meta = { title: 'Field service schedule', height: 460 };
const PRESETS: ViewPresetName[] = ['hourAndDay', 'dayAndWeek', 'weekAndMonth', 'monthAndYear'];
export default function mount(el: HTMLElement): () => void {
const { toolbar, body, status } = layout(el);
const preset = document.createElement('select');
for (const name of PRESETS) preset.add(new Option(name, name, name === 'hourAndDay', name === 'hourAndDay'));
const end = new Date(WEEK_START);
end.setDate(end.getDate() + 7);
const scheduler = createScheduler<ServiceJob, Technician>(body, {
resources: technicians,
events: serviceJobs(),
start: WEEK_START,
end,
viewPreset: 'hourAndDay',
resourceColumns: [
{ field: 'name', header: 'Technician', width: 170 },
{ field: 'skill', header: 'Skill', width: 140 },
],
workingTime: { days: [1, 2, 3, 4, 5], startHour: 8, endHour: 18 },
readOnly: true,
theme: docsTheme(),
height: '100%',
ariaLabel: 'Field service schedule',
});
const onPreset = () => scheduler.setViewPreset(preset.value as ViewPresetName);
preset.addEventListener('change', onPreset);
toolbar.append(
field('View', preset),
button('Zoom in', () => scheduler.zoomIn()),
button('Zoom out', () => scheduler.zoomOut()),
button('Monday 08:00', () => scheduler.scrollToDate(at(0, 8), 'start')),
);
const offs = [
scheduler.on('eventClick', ({ event }) => {
status.textContent = `${event.title} for ${event.customer}`;
}),
scheduler.on('viewPresetChanged', ({ preset: next }) => {
status.textContent = `View preset: ${typeof next === 'object' && 'name' in next ? String(next.name) : 'custom'}`;
}),
];
status.textContent = 'Click a job to see its customer.';
const stopTheme = onDocsThemeChange((theme) => scheduler.update({ theme }));
return () => {
preset.removeEventListener('change', onPreset);
for (const off of offs) off();
stopTheme();
scheduler.destroy();
};
}What it does#
- Resource rows with optional hierarchy: group technicians under depots or rooms under floors with
parentId, and collapse or expand groups. - Time axis presets from 15-minute ticks to whole months, with two-row headers,
zoomIn()andzoomOut(), and fully custom presets. - Drag, resize and drag-to-create with snapping to minutes or to ticks, plus
validateDropandvalidateResizehooks to reject moves your business rules do not allow. - Overlap handling: events that overlap in one row are laid out in lanes.
- Working time: non-working hours and days are shaded, and a "now" line marks the current time.
- Time zones: the whole timeline is computed in an IANA time zone through
Intl, so a dispatcher in Chicago can plan a crew in Berlin on Berlin time, with correct daylight saving transitions. - Virtualization of rows and time, so thousands of resources and long ranges stay fast.
- Keyboard and screen reader support for selecting, moving, resizing and removing events.
Install#
npm install @birchui/schedulerThe package depends on @birchui/core and @birchui/license, which npm installs for you. Styles are injected automatically the first time a scheduler is created. If your Content Security Policy blocks inline styles, set injectStyles: false and import the stylesheet instead:
import '@birchui/scheduler/styles.css';See Installation for bundler notes that apply to every Birch UI package.
Create a scheduler#
createScheduler(container, options) renders into an element you own and returns the scheduler API. The required options are resources plus the visible range, start and end.
import { createScheduler } from '@birchui/scheduler';
const container = document.querySelector<HTMLElement>('#dispatch-board')!;
const scheduler = createScheduler(container, {
resources: [
{ id: 'tech-amira', name: 'Amira Haddad' },
{ id: 'tech-jonas', name: 'Jonas Weber' },
{ id: 'tech-lucia', name: 'Lucía Romero' },
],
events: [
{
id: 'job-4471',
resourceId: 'tech-amira',
title: 'Boiler service, Harbor View Apartments',
start: '2026-12-07T08:00',
end: '2026-12-07T10:30',
},
{
id: 'job-4472',
resourceId: 'tech-jonas',
title: 'Heat pump install, Ortega residence',
start: '2026-12-07T09:00',
end: '2026-12-07T15:00',
color: '#0f766e',
},
{
id: 'job-4475',
resourceId: 'tech-lucia',
title: 'Annual inspection, Northgate Clinic',
start: '2026-12-07T13:00',
end: '2026-12-07T14:30',
},
],
start: '2026-12-07T06:00',
end: '2026-12-07T20:00',
viewPreset: 'hourAndDay',
timeZone: 'America/Chicago',
workingTime: { days: [1, 2, 3, 4, 5], startHour: 8, endHour: 17 },
height: 420,
});
scheduler.on('eventDrop', ({ event, start, end, resourceId }) => {
console.info(`${event.title} moved to ${resourceId}, ${start.toISOString()} to ${end.toISOString()}`);
});Strings such as '2026-12-07T08:00', with no offset, are read as wall-clock time in the scheduler's timeZone. You can also pass Date objects or epoch milliseconds. Resources and events covers the rules.
The widget contract#
Every Birch UI component, the scheduler included, returns an object with the same four members. Framework adapters are thin wrappers around this contract.
| Member | What it does |
|---|---|
element |
The root element the scheduler rendered. |
update(partial) |
Applies only the options you pass, without recreating the scheduler. |
on(event, listener) |
Subscribes to an event and returns an unsubscribe function. Payloads are always objects. |
destroy() |
Removes the DOM and releases every listener, observer and timer. |
scheduler.update({ viewPreset: 'dayAndWeek', start: '2026-12-07', end: '2026-12-14' });
const stop = scheduler.on('eventClick', ({ event, resource }) => {
openJobPanel(event.id, resource?.name);
});
stop();
scheduler.destroy();Beyond the contract, the API has methods for data (setEvents, addEvent, updateEvent, removeEvent, setResources), navigation (setRange, zoomIn, zoomOut, scrollToDate, scrollToEvent) and selection. The API and events page lists them all.
Activate your license#
Set the key once, before the first scheduler is created, or pass it per instance:
import { setLicenseKey } from '@birchui/license';
setLicenseKey(import.meta.env.VITE_BIRCHUI_LICENSE);createScheduler(container, { ...options, licenseKey: 'LQ1.…' });Keys are verified offline in the browser. Nothing is sent over the network, and a paid key never expires. See Licensing and activation for seat rules and the watermark.
Use it in your framework#
Each framework adapter ships the scheduler from a /scheduler subpath, so apps that only use the grid never load scheduler code.
Each example renders the same board, a working week of service jobs, and saves a job when it is dragged. resources, jobs and saveJob are your own data and persistence function.
import { createScheduler } from '@birchui/scheduler';
const scheduler = createScheduler(document.getElementById('dispatch-board')!, {
resources,
events: jobs,
start: '2026-12-07',
end: '2026-12-12',
viewPreset: 'dayAndWeek',
height: 480,
});
scheduler.on('eventDrop', ({ event, start, end, resourceId }) => saveJob(event.id, { start, end, resourceId }));import { BirchScheduler } from '@birchui/react/scheduler';
export function DispatchBoard({ resources, jobs }: DispatchBoardProps) {
return (
<BirchScheduler
resources={resources}
events={jobs}
start="2026-12-07"
end="2026-12-12"
viewPreset="dayAndWeek"
height={480}
onEventDrop={({ event, start, end, resourceId }) => saveJob(event.id, { start, end, resourceId })}
/>
);
}<script setup lang="ts">
import { BirchScheduler } from '@birchui/vue/scheduler';
import type { SchedulerEvents } from '@birchui/scheduler';
defineProps<{ resources: Technician[]; jobs: ServiceJob[] }>();
function onEventDrop({ event, start, end, resourceId }: SchedulerEvents['eventDrop']) {
saveJob(event.id, { start, end, resourceId });
}
</script>
<template>
<BirchScheduler
:resources="resources"
:events="jobs"
start="2026-12-07"
end="2026-12-12"
view-preset="dayAndWeek"
:height="480"
@event-drop="onEventDrop"
/>
</template>import { Component, input } from '@angular/core';
import { BirchSchedulerComponent } from '@birchui/angular/scheduler';
import type { SchedulerEvents } from '@birchui/scheduler';
@Component({
selector: 'app-dispatch-board',
standalone: true,
imports: [BirchSchedulerComponent],
template: `
<birchui-scheduler
[resources]="resources()"
[events]="jobs()"
start="2026-12-07"
end="2026-12-12"
viewPreset="dayAndWeek"
[options]="{ height: 480 }"
(eventDrop)="onEventDrop($event)"
/>
`,
})
export class DispatchBoardComponent {
readonly resources = input.required<Technician[]>();
readonly jobs = input.required<ServiceJob[]>();
onEventDrop({ event, start, end, resourceId }: SchedulerEvents['eventDrop']) {
saveJob(event.id, { start, end, resourceId });
}
}<script lang="ts">
import { BirchScheduler } from '@birchui/svelte/scheduler';
import type { SchedulerEvents } from '@birchui/scheduler';
let { resources, jobs }: { resources: Technician[]; jobs: ServiceJob[] } = $props();
function onEventDrop({ event, start, end, resourceId }: SchedulerEvents['eventDrop']) {
saveJob(event.id, { start, end, resourceId });
}
</script>
<BirchScheduler
{resources}
events={jobs}
start="2026-12-07"
end="2026-12-12"
viewPreset="dayAndWeek"
height={480}
{onEventDrop}
/>import { BirchScheduler } from '@birchui/solid/scheduler';
export function DispatchBoard(props: DispatchBoardProps) {
return (
<BirchScheduler
resources={props.resources}
events={props.jobs}
start="2026-12-07"
end="2026-12-12"
viewPreset="dayAndWeek"
height={480}
onEventDrop={({ event, start, end, resourceId }) => saveJob(event.id, { start, end, resourceId })}
/>
);
}<birchui-scheduler id="dispatch-board"></birchui-scheduler>
<script type="module">
import { defineBirchScheduler } from '@birchui/element/scheduler';
defineBirchScheduler();
const board = document.getElementById('dispatch-board');
board.options = {
resources,
events: jobs,
start: '2026-12-07',
end: '2026-12-12',
viewPreset: 'dayAndWeek',
height: 480,
};
board.addEventListener('event-drop', ({ detail: { event, start, end, resourceId } }) => {
saveJob(event.id, { start, end, resourceId });
});
</script>Notes per adapter:
- React and Solid: options are props, events are
on…props, andrefgives you theSchedulerApi. - Vue: pass options as attributes (kebab-case names are converted to camelCase) or as an
optionsobject; attributes win. Events are kebab-case (@event-drop,@viewport-scroll). The component exposesapi. - Angular:
resources,events,start,end,viewPreset,themeandlicenseKeyare inputs; everything else goes in[options]. Scheduler events are outputs of the same name, such as(eventDrop)and(rangeChanged), and theapiproperty returns theSchedulerApi. - Svelte: every option is a prop, events are
on…props, andbind:apigives you theSchedulerApi. Prefer thebirchScheduleraction, also exported from@birchui/svelte/scheduler, when you want to attach the scheduler to your own element. - Web Component:
<birchui-scheduler>has no per-option properties or attributes. Assign the wholeoptionsobject (or callset(key, value)for one key) and listen for kebab-caseCustomEvents with the payload indetail. Because the scheduler is created as soon as the element is connected and has options, setresources,startandendtogether in oneoptionsassignment. Give the elementdisplay: blockor a height in CSS.
The /scheduler entry points are the only code that imports @birchui/scheduler, so grid-only apps never load it. See Using the Scheduler in your framework for SSR notes and complete examples.
Next steps#
- Resources and events: data shapes, hierarchy, dates and updating data.
- View presets and zoom: choose the time scale and build your own.
- Drag, drop, resize and create: editing by pointer and keyboard, with validation.
- Working time and time zones.
- Event rendering: colors, custom bar content and theming.