WarUI documentation

Region visibility toggles

experimental

Show or hide the header, toolbar and footer with options. Hidden regions are removed from the DOM.

Live example

Expected behavior

Unchecking a region removes it and the body grows to fill the freed space within the fixed 400px height. Re-checking restores it in its original position. The event log prints a regionvisibilitychange entry for each net change.

Source

import { WarCalendar } from '@warlockcode/warui';

const calendar = new WarCalendar(host, { showToolbar: false, showFooter: false });
calendar.on('regionvisibilitychange', ({ region, visible }) => {
  console.log(region, visible);
});
calendar.mount();
calendar.setOptions({ showFooter: true });

API reference

CALE-A01-F03 API
KindNameTypeDescription
MethodsetOptions(options: { showHeader?: boolean; showToolbar?: boolean; showFooter?: boolean }) => voidAccepts showHeader, showToolbar and showFooter (default true). Rapid calls are batched into one layout pass per frame; showBody: false is ignored with a warning. If the focused region is removed, focus moves to the first focusable element of the body (or the body) and the change is announced politely.
Methodon(type: 'regionvisibilitychange', listener: (detail: { region: RegionName; visible: boolean }) => void) => () => voidThe regionvisibilitychange event reports { region, visible } for every net visibility change.