Calendar / Scheduler
ProMonth, week, day, agenda and year views (plus a planner week time-grid) with color-coded event chips, keyboard navigation, a today highlight and opt-in drag-to-create. Recurring series are expanded by the calendar itself from an RFC 5545 RRULE, with EXDATE and moved occurrences; an event dialog edits one occurrence, the rest of a series or all of it; a calendar `timeZone` converts each event from its own; `.ics` files import and export. Emits the visible date range so you fetch only what is on screen, and `view` / `focusedDate` are two-way bindable for deep links. `sv-scheduler`, in the same package, shows the same events against resources.
Complexity tier: Application The interactive bar, plus a stated data-volume ceiling, a persistence contract, a bundle budget and an accessible parity surface.
Dataset size: up to 200 events in the visible range recommended, 1,000 maximum. Fetch only the visible range (`rangeChange`); `maxEventsPerDay` (3 by default) caps the chips a month cell draws behind a named "+N more". Past ~1,000 events in one range, aggregate (a count per day) rather than drawing each one. The same numbers hold for `sv-scheduler`: collapse the groups you are not looking at (`collapsed`), and in the month timeline show a count per resource rather than every booking.
import { SvEventCalendarComponent } from '@styloviz-pro/scheduler';Demo & usage
Basic usage
Usage example — open the gallery for the full interactive demo.
An interactive demo for this component lives in the gallery.
Open live demoMore examples
Let a browser agent drive it (WebMCP)
Wired to an API — fetch only what is on screen
Week view, Monday start
Planner with drag-to-create
A recurring series, edited in scope
A calendar zone, and events that carry their own
Import and export .ics
When to use
Showing scheduled events across month, week, day or agenda views. You want color-coded categories and click-to-create/inspect. For activity history (not scheduling), use the Timeline.
Compare with
- Slot Picker — Slot Picker is the booking side of the same diary: a customer sees only the free times, judged by the same `svCheckSlot` rules. Use Calendar / Scheduler to show and edit every booking; use Slot Picker to let someone take one.
Async states
- loading
- error
- retry
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| events | readonly CalendarEvent[] | [] | Calendar events for the currently visible range. Fetch them from `rangeChange` rather than loading a year at a time. |
| locale | string | svLocale() | BCP 47 locale for dates and numbers. |
| timeZone | string | null | null | The IANA zone the calendar shows times in — `'Europe/Berlin'`. When set, an event carrying its own `timeZone` is converted into it and says where it came from ("09:00 to 10:00 in New York"). When `null`, nothing is converted: the grid draws every date and time as given. |
| views | readonly CalendarView[] | ['month', 'week', 'agenda'] | The views the switcher offers, in order. Add `'day'` and `'year'` to offer them; a `view` that is not listed still renders. |
| eventDialog | boolean | false | Open the event details dialog when an event is activated: its time, the repeat rule in words, a moved occurrence's original day, the zone it was written in. `eventClick` still fires. |
| editable | boolean | false | Let the dialog change an event's date and times and delete it — with "this event / this and following / all events" for a recurring one. The calendar never writes: apply `eventChange` / `eventRemove` with `svApplyEventChange` / `svApplyEventRemoval` and send the events back. |
| view | CalendarView (two-way) | 'month' | Active view. Two-way bindable — `[(view)]` keeps it in the URL so a shared link reopens the week the sender was looking at. Still emits `viewChange`. |
| variant | CalendarVariant | 'default' | Visual variant. |
| weekStart | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 1 | Which weekday a week begins on, `0` Sunday to `6` Saturday. Any day, not only Sunday or Monday: Saturday is the working-week start across much of the Middle East and North Africa. |
| maxEventsPerDay | number | 3 | The most event chips a month-view day cell draws. The rest collapse into a "+N more" button, named with the count and the date, that opens the day in the week view where every event is listed. Values below 1 count as 1. No event is hidden without a count on screen and in the accessibility tree. |
| focusedDate | string (two-way) | toDateStr(new Date()) | The date the calendar is centred on, `YYYY-MM-DD`. Two-way bindable, so the month the user navigated to survives a reload or a deep link. Defaults to today. |
| loading | boolean | false | True while the visible range is being fetched. Replaces the grid with a placeholder on first load. |
| error | SvDataError | string | null | null | Load failure for the visible range. Use `toSvDataError()` from `@styloviz/core` to normalize an `HttpErrorResponse`. |
| showZonePolicy | boolean | true | Show the one-line zone policy under the calendar — whether times are shown as given or converted into `timeZone` — so the reader knows which. Hide it only when the host states the policy itself. |
| creatable | boolean | false | Enable drag-to-create in the planner (week time-grid). |
| notes | Record<string, string> (two-way) | {} | Day notes keyed by ISO date (two-way: `[(notes)]`). |
Outputs
| Event | Payload type | Description |
|---|---|---|
| eventClick | CalendarEvent | Emitted with the clicked event. |
| dateClick | string | Emitted with the clicked date (ISO string). |
| rangeChange | CalendarRange | The visible date range changed — fetch the events for it. Emitted on first render and whenever the user navigates or switches view, never twice for the same range. This is what makes the calendar usable against a real backend: without it a host has to load every event that exists, because it cannot know what the component is about to show. ```ts onRangeChange({ start, end }: CalendarRange): void { this.loading.set(true); this.api.events(start, end).subscribe((events) => { this.events.set(events); this.loading.set(false); }); } ``` |
| retry | void | The host should re-run the failed load. |
| eventChange | SvEventChange | The user changed an event in the dialog — `events = svApplyEventChange(events, $event)`. |
| eventRemove | SvEventRemoval | The user deleted an event in the dialog — `events = svApplyEventRemoval(events, $event)`. |
| rangeSelect | { date: string; startTime: string; endTime: string; title?: string } | Emitted when the user drags out a new time range in the planner. `title` is set only by the `create_event` WebMCP tool. |
| viewChange | CalendarView | Emits the new `view` whenever it changes — the output half of `[(view)]`. |
| focusedDateChange | string | Emits the new `focusedDate` whenever it changes — the output half of `[(focusedDate)]`. |
| notesChange | Record<string, string> | Emits the new `notes` whenever it changes — the output half of `[(notes)]`. |
Wire it to your API
This component is headless about transport: it renders what you give it and reports what the user asks for. Nothing below requires @styloviz/data — drive it from whatever you already use.
Template
Bound to the names this component actually exposes.
Host class
Drive the three async inputs from your own fetch.
This component does not emit a query, so it renders what you give it. Call `load()` on your own trigger and bind `events`, `loading` and `error`. Normalize failures with `toSvDataError()` from `@styloviz/core`. It derives `retryable` from the status, so a 404 does not get a "Try again" button that can only fail again.
Full walkthrough: Connecting to a backend.
Customization & theming
`rrule` (RFC 5545: DAILY / WEEKLY / MONTHLY / YEARLY with INTERVAL, COUNT, UNTIL, BYDAY with ordinals, BYMONTHDAY, BYMONTH, BYSETPOS, WKST) and `exdates` make an event a series the calendar expands. A rule part it does not support is refused out loud — the event is drawn once and the notice above the grid names it. `views` lists the switcher's views; add `'day'` and `'year'` to offer them. The year view shades each day by how busy it is and opens it in the day view. `eventDialog` opens the details dialog on an event (the rule in words, a moved occurrence's original day, the zone it was written in); `editable` adds date and time fields, Delete, and the three scopes — the calendar emits `eventChange` / `eventRemove` and never writes. `readOnly: true` on an event keeps its dialog read-only and refuses `requestEventChange` (and, in `sv-scheduler`, a drag or a keyboard move) with the reason. `timeZone` (an IANA name) converts every timed event that carries its own `timeZone`; `null` keeps the wall-clock grid. `maxEventsPerDay` (default 3) caps the chips a month-view day draws; the rest collapse into a "+N more" button that opens the day in the week view, where every event of the day is listed. Overlapping events are laid out in side-by-side lanes rather than stacked, sized per cluster — two meetings at 9am and two at 4pm need two lanes, not four. Touching is not overlapping, so a day of back-to-back meetings stays full width. `weekStart` takes any weekday, 0 Sunday to 6 Saturday — Saturday is the working-week start across much of the Middle East and North Africa. `endDate` for multi-day events, and `recurrence` for a repeat disclosure. Switch month / week / day / agenda views, plus default / compact / timeline / planner variants. Color-coded event categories. In the planner, set `creatable` to drag out a new time range (15-min snap, live preview) — `rangeSelect` emits `{ date, startTime, endTime }` for your store. Today indicator and custom event templates.
Best practices
Do: Decide whose zone wins, and say so with `timeZone`. Without it the calendar is a wall-clock grid: it renders the YYYY-MM-DD and HH:MM it is given and never converts, so 09:00 shows at 09:00 for every viewer — the component will not guess, because any guess is wrong for somebody. Give it a `timeZone` and each event that carries its own `timeZone` is converted into it, and says where it came from. Tip: A DST changeover does not break the grid, because the times shown are the ones a local clock will show. It does break a DURATION read off the grid: on the spring-forward day 01:30 to 03:30 is two hours on the clock and one in real time. The changeover day is named under the plot for that reason. Do: Send a recurring event once, with an `rrule`, and let the calendar expand it across the range it shows. Cancelled days go in `exdates`; a moved or changed occurrence is an ordinary event with `seriesId` and `originalDate`. `svApplyEventChange` / `svApplyEventRemoval` write all three scopes for you, so the hard part of recurrence — owning the exceptions — is not left to your backend. Don't: Do not hand-roll an RRULE parser for the backend. `svExpandRRule`, `svParseIcs` and `svToIcs` are plain functions with no Angular dependency, and they are checked against RFC 5545's own worked examples. Do: Use endDate for anything spanning more than one day. Without it a conference over a long weekend can only be sent as separate events that do not know they are one thing. Do: Color-code events by category consistently and expose a legend. Do: Respect locale with `weekStart` (Sunday vs Monday). Tip: Default to the view that matches the data density — agenda for sparse, week for busy. Do: Fetch from `(rangeChange)` rather than loading a year of events up front — the range it hands you is exactly what is about to be drawn. Don't: Do not fetch only the focused calendar month. Month view shows leading and trailing days from the neighbouring months, and `rangeChange` accounts for them.
Accessibility
A recurring occurrence says its rule in words in its accessible name ("Every week on Monday, Wednesday and Friday"), and a moved one adds "Moved from Wednesday, November 11, 2026"; a converted event adds the time it was written in ("09:00 to 10:00 in New York"). The event dialog is a native modal `<dialog>`: focus moves to its heading, the page behind is inert, Escape closes it, and focus returns to the event. The three scopes are a native radio group; a refusal is a `role="alert"` sentence naming the reason. The year view is one tab stop for 365 days: arrows move by day and week, Page Up / Page Down by month, Home / End to the ends of the week; every day is named with its date and event count, and today carries `aria-current="date"`. A month cell never drops an event silently: past `maxEventsPerDay` it shows a "+N more" `<button>` named with the count and the date ("Show 2 more events on Wednesday, June 10, 2026"), and activating it opens the week view with focus on that day. Concurrent events are given lanes so none is hidden behind another. Two events at the same hour sit side by side, so a double-booked morning never looks free. A recurring event carries its rule in WORDS in its accessible name, not only as a repeat glyph: moving next Tuesday's stand-up and moving every Tuesday's are different actions, and the glyph says nothing to a screen reader. The month view is a true ARIA `grid` (rows of day `gridcell`s) with roving-tabindex day buttons: arrow keys move between days, Home/End jump to week ends, Enter/Space select; each day is labelled with its full date, event count and today state. Prev/next controls are labelled per view, the period heading is a polite live region, and the view switcher exposes `aria-pressed`. Today is marked with `aria-current="date"`; events activate on Enter/Space and expose their title to assistive tech.
Feedback on Calendar / Scheduler
Spotted a gap in this page, or something that didn't work as described? Comments are GitHub Discussions in the public styloviz/community repo, so posting needs a GitHub account.