scheme
Whether the calendar is drawn light, dark, or as the page is.
| Type | 'auto' | 'light' | 'dark' |
|---|---|
| Default | 'auto' |
Live update (update()) | Yes |
| Declared in | packages/dom/src/calendar.ts |
What it does
Section titled “What it does”'auto': as the page — the system’s preference (prefers-color-scheme), or adata-theme="light"/"dark"on an ancestor of the calendar (a site’s own switch).'light','dark': that side of the theme, whatever the page.
Every family (theme) has both sides. It changes live: a site’s own
light/dark switch passes its value here.
Example
Section titled “Example”import { createCalendar } from '@dzcalendar/dom';
const calendar = createCalendar(element, { timeZone: 'Europe/Paris', scheme: 'auto' });
// The site's own switch.document.getElementById('dark-mode')!.addEventListener('change', (e) => calendar.update({ scheme: (e.target as HTMLInputElement).checked ? 'dark' : 'light' }));import { Component } from '@angular/core';import { DZ_CALENDAR } from '@dzcalendar/angular';
@Component({ selector: 'app-agenda', imports: [DZ_CALENDAR], template: `<dz-calendar timeZone="Europe/Paris" scheme="dark" />`,})export class Agenda {}import { DzCalendar } from '@dzcalendar/react';
export function Agenda() { return <DzCalendar timeZone="Europe/Paris" scheme="dark" />;}<script setup lang="ts">import { DzCalendar } from '@dzcalendar/vue';</script>
<template> <DzCalendar time-zone="Europe/Paris" scheme="dark" /></template>In the frameworks it is an Angular input (scheme) and a React and Vue prop (scheme, scheme).
Live demo
Section titled “Live demo”The week drawn dark, whatever the page.