Scheduler Views
Choose the available views, their order and settings.
Configured views
The following example demonstrates a custom view list. Appointments is Day with a shorter time window and no all-day strip. Weekly plan inherits the global settings. Remove Appointments while it is active to try the fallback.
2026-12-02 – 2026-12-02
Active view: day
views: readonly NgbSchedulerViewConfig[] = [
{ type: 'day', label: 'Appointments', options: {
startTime: '09:15', endTime: '16:45', slotDuration: 60,
slotDivisions: 2, showAllDay: false
} },
{ type: 'week', label: 'Weekly plan' },
{ type: 'agenda', label: 'Event list', options: { hiddenDays: [] } }
];
// <ngb-scheduler [date]="date" [(view)]="active" [views]="views"
// [hiddenDays]="[0, 6]" scrollTime="10:00" />
Inheritance
NgbSchedulerViewConfig supplies a type, optional label and options. Explicit per-view values override Scheduler inputs; omitted or undefined values inherit. False remains false. Inputs are not mutated when switching views.
Supported overrides
Day, Multi-Day, Week and Work Week support minute boundaries, duration, subdivisions, density, all-day visibility and current-time visibility. Multi-Week, Month, Week, Work Week, Timeline Week and Year accept weekStartsOn; Multi-Week accepts multiWeekCount; Multi-Day accepts multiDayCount; Work Week accepts workDays. Multi-Day, Week, Work Week, Month, Multi-Week, Agenda, Timeline Week and Timeline Month support hiddenDays; an empty override shows all days permitted by that view. Time-grid views also support scrollTime.
Validation and switching
Choose from eleven built-in views and one optional Custom View. Use each type once. Labels must be nonempty, and options must be valid for their view. Invalid options, including an empty workDays array, produce an error rather than inheriting silently. When the requested view is absent, the first configured view becomes active and emits viewChange. Bind [(view)] to keep application state in sync.
Label, order and display-only changes reuse loaded events. Switching the active view or its date range triggers one datasource request. Global hiddenDays hides weekends in this example; Event list overrides it with an empty array. Work Week still respects workDays. The 10:00 scroll target applies after browser rendering and on date/view changes. Manual scrolling is retained for data-only updates.
Declarative views
Import NgbSchedulerViewDirective and place one template directly inside the Scheduler for each view. Declaration order controls the switcher. Choose Morning to see the shorter time window.
2026-12-02 – 2026-12-08
Wed, Dec 2
Thu, Dec 3
Fri, Dec 4
- No events
Sat, Dec 5
- No events
Sun, Dec 6
- No events
Mon, Dec 7
- No events
Tue, Dec 8
- No events
<ngb-scheduler date="2026-12-02" view="agenda" [events]="events">
<ng-template ngbSchedulerView="agenda" label="Review list" />
<ng-template ngbSchedulerView="day" label="Morning" [options]="{startTime:'09:00', endTime:'12:00'}" />
</ngb-scheduler>
While any declarations are present, they supply the complete list. Removing the active view selects the first remaining view. Removing all declarations restores the views input or its default. The same validation and option inheritance apply to both forms.