views
Lists the views the calendar instantiates and shows in the toolbar mode switcher. Each entry is either a registered view id or a ViewConfig object that relabels the view or deep-merges section overrides.
Usage
views?: (string | ViewConfig)[];
type ViewConfig =
| string
| {
id: string;
label?: string;
sections?: Record<string, any>;
};
| Field | Type | Description |
|---|---|---|
id | string | View id; must match a registered view (day, week, month, agenda, year, resources, timeline, or a custom id from registerCalendarView) |
label | string | Display label in the mode switcher; falls back to the localized view id |
sections | Record<string, any> | Per-section overrides keyed by section name (e.g. timeGrid, multiday); deep-merged into the defaults |
Default: ["day", "week", "month"].
Example
String entries:
<Calendar
events={data}
view="week"
views={["day", "week", "month", "agenda", "year"]}
/>
ViewConfig with section overrides:
<Calendar
events={data}
view="week"
views={[
{
id: "week",
label: "Week",
sections: {
timeGrid: {
yScale: { startHour: 6, endHour: 22, snapStep: 15 },
},
},
},
"month",
]}
/>
Related articles
view— pick the active view from this list.registerCalendarView— add a custom view class to the registry.- Custom views — section overrides and
ViewModelsubclasses. - Scales — tuning hours, slot size, and snap on the time axis.