Views

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. A name that is neither built in nor registered draws the week view, with a warning in development, and the bound value is left as given.

view: week

Nov 30 – Dec 6, 2026

GMT+7
Mon 30
Tue 1
Wed 2
Thu 3
Fri 4
Sat 5
Sun 6
All day
Lunch break
<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

ViewRange
dayOne day
weekSeven days from weekStartsOn, or days days from date
monthWhole weeks covering the month, five or six rows
yearJanuary 1 to December 31
agendaThe 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.

date: 2026-12-06

December 2026

Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
<!-- 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.

view: year

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.

December 2026

  • Tuesday, December 1

    3 events · 3h 15m
  • Wednesday, December 2

    4 events · 3h 15m
  • Thursday, December 3

    3 events · 1h 45m
  • Friday, December 4

    4 events · 4h 45m
  • Saturday, December 5

    1 event · 1h
  • Monday, December 7

    2 events · 1h 15m
  • Tuesday, December 8

    1 event · 15m
  • Wednesday, December 9

    2 events · 15m
  • Thursday, December 10

    1 event · 15m
  • Friday, December 11

    1 event · 15m
  • Monday, December 14

    1 event · 15m
  • Tuesday, December 15

    2 events · 15m
  • Wednesday, December 16

    2 events · 15m
  • Thursday, December 17

    1 event · 15m
  • Friday, December 18

    1 event · 15m
  • Monday, December 21

    1 event · 15m
  • Tuesday, December 22

    1 event · 15m
  • Wednesday, December 23

    1 event · 15m
  • Thursday, December 24

    1 event · 15m
  • Friday, December 25

    1 event · 15m
  • Monday, December 28

    1 event · 15m
  • Tuesday, December 29

    1 event · 15m
  • Wednesday, December 30

    1 event · 15m
  • Thursday, December 31

    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.

2026-12-06T16:44:02.249+07:00[Asia/Ho_Chi_Minh]

Nov 30 – Dec 6, 2026

GMT+7
Mon 30
Tue 1
Wed 2
Thu 3
Fri 4
Sat 5
Sun 6
All day
Lunch break
<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.

Nov 30 – Dec 6, 2026

GMT+7
Mon 30
Tue 1
Wed 2
Thu 3
Fri 4
Sat 5
Sun 6
All day
Lunch break
<!-- 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.

2026-12
  • Tuesday, December 1

    3 events · 3h 15m
  • Wednesday, December 2

    4 events · 3h 15m
  • Thursday, December 3

    3 events · 1h 45m
  • Friday, December 4

    4 events · 4h 45m
  • Saturday, December 5

    1 event · 1h
  • Monday, December 7

    2 events · 1h 15m
  • Tuesday, December 8

    1 event · 15m
  • Wednesday, December 9

    2 events · 15m
  • Thursday, December 10

    1 event · 15m
  • Friday, December 11

    1 event · 15m
  • Monday, December 14

    1 event · 15m
  • Tuesday, December 15

    2 events · 15m
  • Wednesday, December 16

    2 events · 15m
  • Thursday, December 17

    1 event · 15m
  • Friday, December 18

    1 event · 15m
  • Monday, December 21

    1 event · 15m
  • Tuesday, December 22

    1 event · 15m
  • Wednesday, December 23

    1 event · 15m
  • Thursday, December 24

    1 event · 15m
  • Friday, December 25

    1 event · 15m
  • Monday, December 28

    1 event · 15m
  • Tuesday, December 29

    1 event · 15m
  • Wednesday, December 30

    1 event · 15m
  • Thursday, December 31

    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.

Nov 30 – Dec 6, 2026

GMT+7
Mon 30
Tue 1
Wed 2
Thu 3
Fri 4
Sat 5
Sun 6
All day
// 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.

PropTypeDefault
viewstring'week'
dateZonedDateTimetoday
daysnumber-
weekStartsOnWeekDay1
hiddenDaysWeekDay[][]
toolbarboolean | Snippet<[ToolbarSnippetProps]>true
viewsViewDefinition<T>[][]