density
How much room the calendar’s rows and paddings take.
| Type | 'compact' | 'comfortable' | 'spacious' |
|---|---|
| Default | 'comfortable' |
Live update (update()) | Yes |
| Declared in | packages/dom/src/calendar.ts |
What it does
Section titled “What it does”'compact', 'comfortable' (the default) or 'spacious': an hour of a time
grid is 48, 72 or 96 px tall, and the height of the bars and the day heads,
the month’s weeks and the type size follow. A narrow side panel takes
compact, a wall screen spacious. --dz-minute (the pixels of a minute) and
the other --dz-* variables set any other size — on .dz-cal itself, since
a density sets them there.
Example
Section titled “Example”import { createCalendar } from '@dzcalendar/dom';
createCalendar(element, { timeZone: 'Europe/Paris', density: 'compact' });import { Component } from '@angular/core';import { DZ_CALENDAR } from '@dzcalendar/angular';
@Component({ selector: 'app-agenda', imports: [DZ_CALENDAR], template: `<dz-calendar timeZone="Europe/Paris" density="compact" />`,})export class Agenda {}import { DzCalendar } from '@dzcalendar/react';
export function Agenda() { return <DzCalendar timeZone="Europe/Paris" density="compact" />;}<script setup lang="ts">import { DzCalendar } from '@dzcalendar/vue';</script>
<template> <DzCalendar time-zone="Europe/Paris" density="compact" /></template>In the frameworks it is an Angular input (density) and a React and Vue prop (density, density).
Live demo
Section titled “Live demo”The week, compact: an hour 48 px tall.