Skip to content

Theming

Import the package stylesheet, then adjust it at the level you need. Both UI packages use the same variables.

Set them on the container or :root:

#calendar {
--ww-accent: #7c3aed; /* today, focus rings, picker */
--ww-event-bg: #ede9fe;
--ww-event-border: #ddd6fe;
--ww-event-text: #4c1d95; /* also the dot of month-view events */
--ww-now: #f97316; /* "now" line */
--ww-surface: #fff; /* around the card; match your page */
}
Result· pick a theme

The date picker popover and drag previews, which render in document.body, pick the variables up from the calendar automatically. All variables.

The content is yours to render (see Rendering events); in the DOM package eventClassName adds classes that can set the variables for one event.

Every element of the DOM package has a stable ww- class (.ww-event, .ww-month__day, .ww-toolbar__view--active) and state attributes ([data-today], [data-outside], [data-disabled], [data-past]). The built-in styles live in the weekwise cascade layer, so any of your own CSS overrides them regardless of specificity:

.ww-event {
border-radius: 8px;
font-weight: 600;
}

If your site puts its own styles in cascade layers too (a CSS reset, a framework such as Starlight or Tailwind), declare the order before any stylesheet, so the calendar’s layer comes after the reset:

<style>@layer reset, weekwise;</style>

The calendar adapts to the width of its container, not of the window, so it fits a widget or a side panel as well as a phone:

Width Layout
over 900px Regular
521–900px Compact: a lower toolbar and day header, 44px hours, no lines between time steps
up to 520px Narrow: also 40px hours, and the view tabs become a list

In a scrollable timeline, buttons at the top and bottom of each day point to the events out of view and scroll to them. The React calendar marks the layout with data-ww-size="compact" or "narrow" on its root, the DOM one with the ww-calendar--compact and ww-calendar--narrow classes; an explicit rowHeight (DOM package) keeps its hour height at every size.