Views & Navigation
Five views share one set of events and one anchor date. Switch between them from the toolbar or from anything bound to the same state.
Five Views
view names the active view and is bindable. Each view computes its range from date and moves it by one period when the arrows are pressed.
Oct 19 – 25, 2026
<script lang="ts">
import { Scheduler, type EventInput } from '@sv5ui/scheduler';
let events = $state<EventInput[]>([/* ... */]);
let view = $state('week'); // 'month' | 'week' | 'day' | 'year' | 'agenda', or a registered name
</script>
<!-- The toolbar switches it; so can anything bound to the same state -->
<Scheduler bind:events bind:view timeZone="Asia/Ho_Chi_Minh" height={560} />What each view shows
| View | Range |
|---|---|
day | One day |
week | Seven days from weekStartsOn, or days days from date |
month | Whole weeks covering the month, five or six rows |
year | January 1 to December 31 |
agenda | The calendar month, first to last day |
Month
Whole weeks from the first to the last day of the month, so the grid always starts on weekStartsOn. A timed event is a pill with its start time; an event that spans days is a bar that
continues across rows. Each cell shows as many rows of events as its height allows and folds
the rest into a +N button that opens the full list. Rows never shrink below 62px: give the scheduler less height
and the grid scrolls. Clicking an empty cell moves date to that day and reports it through onSelectSlot. Today holds more events than its cell can show, so it folds.
October 2026
<!-- A month cell shows as many rows as its height allows and folds the rest into +N.
Rows are at least 62px tall; below that the grid scrolls instead of shrinking. -->
<Scheduler bind:events view="month" height={560} />
<!-- Clicking an empty cell moves date to that day, and reports it -->
<Scheduler bind:events view="month" bind:date onSelectSlot={({ start }) => console.log(start)} />Week and Day
Both draw the time grid: an hour gutter, one column per day, an all-day row when there is something to put in it, and a red line at the current time. The day view replaces the row of column headers with a large title carrying the weekday, a Today badge and the holiday name when there is one. The grid itself, its slots, visible hours, overlap and scrolling are on the Time Grid page.
Year
Twelve small months, with a dot under every day that has at least one event. It is a map rather than a workspace: nothing can be dragged here and the rendering snippets are not applied. Click a month title to open that month, or a day to open that day.
2026
<!-- Twelve months at a glance. A dot marks a day with events.
A month title opens that month; a day opens that day. -->
<Scheduler bind:events view="year" height={640} />Agenda
The calendar month as a list. Events are grouped by day, days without events are left out, and each heading counts the events and adds up the booked hours. An event across several days is listed under each of them. It is the view that fits a phone or a narrow panel.
October 2026
Monday, October 5
1 event · 15mTuesday, October 6
1 event · 15mWednesday, October 7
1 event · 15mThursday, October 8
1 event · 15mFriday, October 9
1 event · 15mMonday, October 12
1 event · 15mTuesday, October 13
1 event · 15mWednesday, October 14
1 event · 15mThursday, October 15
1 event · 15mFriday, October 16
2 events · 1h 45mSaturday, October 17
1 event · 45mMonday, October 19
2 events · 1h 45mTuesday, October 20
Today 3 events · 3h 15mWednesday, October 21
4 events · 3h 15mThursday, October 22
3 events · 1h 45mFriday, October 23
4 events · 4h 45mSaturday, October 24
1 event · 1hMonday, October 26
2 events · 1h 15mTuesday, October 27
1 event · 15mWednesday, October 28
2 events · 15mThursday, October 29
1 event · 15mFriday, October 30
1 event · 15m
<!-- One calendar month as a list, grouped by day; empty days are left out.
Each heading counts the events and adds up the booked time. -->
<Scheduler bind:events view="agenda" height={480} />Navigating From Code
Bind date and view and set them from anywhere. date is a ZonedDateTime; one carrying another zone is converted to the scheduler's zone before the range is
computed, so noon in New York lands on the calendar day that instant falls on in Ho Chi Minh
City. A toolbar snippet gets the same moves as functions.
Oct 19 – 25, 2026
<script lang="ts">
import { now, parseZonedDateTime } from '@internationalized/date';
import { Scheduler, type EventInput } from '@sv5ui/scheduler';
const zone = 'Asia/Ho_Chi_Minh';
let events = $state<EventInput[]>([/* ... */]);
let view = $state('week');
let date = $state(now(zone));
</script>
<Scheduler bind:events bind:view bind:date timeZone={zone} height={520} />
<!-- Anything that sets date or view moves the calendar -->
<Button label="Today" onclick={() => (date = now(zone))} />
<Button label="Next week" onclick={() => (date = date.add({ weeks: 1 }))} />
<Button label="New year" onclick={() => { date = parseZonedDateTime(`2027-01-01T00:00[${zone}]`); view = 'day'; }} />
<!-- date may carry another zone; it is converted before the range is computed -->
<Button label="Same instant, New York" onclick={() => (date = parseZonedDateTime('2026-09-16T12:00[America/New_York]'))} />Custom Week Lengths
days makes the week view show that many days starting on date rather than a calendar week, and the arrows step by the same amount. For a fixed Monday to Friday
week that still steps by seven days, register a view instead: see Custom Views & Layouts.
Oct 19 – 25, 2026
<!-- days makes the week view show that many days starting on date,
and the arrows step by the same amount. weekStartsOn no longer applies. -->
<Scheduler bind:events view="week" days={3} />
<Scheduler bind:events view="week" days={14} />Hiding the Toolbar
toolbar={false} removes it, for a calendar inside a page that already has navigation of its own. Here an agenda
in a narrow panel, moved by the two buttons above it.
Monday, October 5
1 event · 15mTuesday, October 6
1 event · 15mWednesday, October 7
1 event · 15mThursday, October 8
1 event · 15mFriday, October 9
1 event · 15mMonday, October 12
1 event · 15mTuesday, October 13
1 event · 15mWednesday, October 14
1 event · 15mThursday, October 15
1 event · 15mFriday, October 16
2 events · 1h 45mSaturday, October 17
1 event · 45mMonday, October 19
2 events · 1h 45mTuesday, October 20
Today 3 events · 3h 15mWednesday, October 21
4 events · 3h 15mThursday, October 22
3 events · 1h 45mFriday, October 23
4 events · 4h 45mSaturday, October 24
1 event · 1hMonday, October 26
2 events · 1h 15mTuesday, October 27
1 event · 15mWednesday, October 28
2 events · 15mThursday, October 29
1 event · 15mFriday, October 30
1 event · 15m
<!-- No toolbar: the surrounding page navigates through bind:date and bind:view -->
<Scheduler bind:events bind:date view="agenda" toolbar={false} height={420} />Events Longer Than a Day
A timed event shorter than a day that crosses midnight stays in the time grid, split at the day line into two segments. A timed event of twenty four hours or more is drawn like an all-day one, in the all-day row and as a bar across month cells, because a block filling a whole column would hide everything under it.
Oct 19 – 25, 2026
// Across midnight, shorter than a day: stays in the time grid, split at the day line
{ id: 'release', title: 'Release window', start: '2026-09-18T22:00', end: '2026-09-19T01:00' }
// Twenty four hours or more: drawn in the all-day row and as a bar in the month,
// even without allDay
{ id: 'oncall', title: 'On call', start: '2026-09-14T09:00', end: '2026-09-15T09:00' }Props
The props this page uses. view and date are bindable.
| Prop | Type | Default |
|---|---|---|
view | string | 'week' |
date | ZonedDateTime | today |
days | number | - |
weekStartsOn | WeekDay | 1 |
hiddenDays | WeekDay[] | [] |
toolbar | boolean | Snippet<[ToolbarSnippetProps]> | true |
views | ViewDefinition<T>[] | [] |