WarUI documentation

Minimal calendar mount

experimental

Mount a WarCalendar into a host element with no options and get a default month view.

Live example

Expected behavior

Mount renders the month of the current date inside the host. The JSON panel lists every resolved default. Unmount removes all calendar DOM and the host returns to its empty outline.

Source

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

const calendar = new WarCalendar(document.querySelector('#host'));
calendar.mount();
console.log(calendar.defaults);
calendar.unmount();

API reference

CALE-A01-F01 API
KindNameTypeDescription
Functionnew WarCalendar(el: HTMLElement | string, options?: WarCalendarOptions) => WarCalendarCreates an unmounted calendar for an element or a selector. Throws a descriptive error for null or unmatched targets. Existing children of the host are preserved.
Methodmount() => voidRenders one root with class war-calendar (role region, aria-label "Calendar"). A second call is ignored and warns once in development mode.
Methodunmount() => voidRemoves the calendar root and all of its DOM.