Skip to content

headerViews

The views the header’s switcher offers, in order.

Typereadonly string[]
Defaultmonth, week and day — the views whose renderer is imported
Live update (update())Yes
Declared inpackages/dom/src/calendar.ts

Without headerToolbar, the header’s end is these views joined as one switcher, the current one pressed. By default: month, week and day — those whose renderer is imported (dayGridMonth, timeGridWeek, timeGridDay with @dzcalendar/dom). Name any view: a built-in one, one of your views, listWeek with @dzcalendar/dom/list. A single view: no switcher.

With headerToolbar given, the views are named there instead and this option is not read. A view whose renderer is not imported is left out and said once on the console. The buttons’ words come from messages.views.

import { createCalendar } from '@dzcalendar/dom';
import '@dzcalendar/dom/list';
const calendar = createCalendar(element, { timeZone: 'Europe/Paris', headerViews: ['dayGridMonth', 'timeGridWeek', 'listWeek'] });
// Later: the week alone (no switcher).
calendar.update({ headerViews: ['timeGridWeek'] });

In Angular and Vue it goes in options; in React it is a prop.

The header offers the month, the week and the list.