Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…

Read the release notes

day-view

Hour-grid schedule for a single day using calendar-event and hour-view elements with two-layer rendering for multi-hour spanning.

Overview

The <day-view> component renders a day schedule as an hour grid. Authors write semantic markup using <ol>, <time>, <hour-view>, and <calendar-event>. The component enhances this with a two-layer rendering system: CSS Grid for the hour layout, and JS absolute positioning for events that span multiple hours.

Markup Pattern

Each hour is an <li> containing a <time> label and an <hour-view> container. Events go inside <hour-view> as <calendar-event> elements.

ElementPurpose
<ol>Ordered list of hour slots
<li>One hour: contains <time> + <hour-view>
<time datetime="HH:00">Hour label
<hour-view>Subgrid container for events within the hour
<calendar-event>Individual event with time, category, duration

Attributes

AttributeTypeDefaultDescription
data-date ISO date — The date this view represents. Names the hour list for assistive tech (“Friday, April 10, 2026”) and is passed as detail.date in day-view:event-click.
data-start-hour number | "auto" 7 First hour of the grid the component generates when you place <calendar-event> children directly inside (no <ol>), or "auto" for a sparse range around the events. A numeric range grows to fit events outside it. Ignored when you author the <ol>.
data-end-hour number 19 Last hour of the generated grid. Ignored when data-start-hour="auto" or the <ol> is authored.
data-compact boolean — Compact presentation for embedding in dialogs or overlays.
data-label-continues string "continues after the visible hours" Appended to the accessible name of a spanning event clipped at the last visible hour. Localisation hook.

Generated Grid

Place <calendar-event> children directly inside <day-view> (no <ol>) and the component builds the hour grid from each event’s <time datetime>. Untimed events go to an all-day strip.

  • data-start-hour="auto": sparse range, first event hour − 1 to last event hour + 1.
  • Numeric data-start-hour / data-end-hour (default 7–19): a fixed range that grows to fit any event outside it, so no event is dropped.
  • datetime may be HH:MM or a full ISO datetime (2026-04-10T09:30:00Z). The wall-clock time is used as written; offsets are not converted to local time.

This is used by <calendar-wc> to render day detail overlays from event data.

Half-Hour Events

Events starting at :30 are placed in the bottom half of their hour row using data-start="30".

Multi-Hour Events

Add data-duration to span across multiple hour rows. The component positions these events absolutely over the grid using measured coordinates.

Supported data-duration formats
FormatExamples
Hours (decimals allowed)2h, 1.5h
Minutes45m, 90m, 90min
Hours and minutes1h30m, 1h 30m
Bare number (minutes)60
ISO-8601 durationPT1H30M, PT45M

Anything else (including zero) falls back to one hour. <week-view> reads durations the same way.

Leave the subsequent hour's <hour-view> empty — the spanning event overlays it visually. Spans are re-measured whenever the view resizes; call refresh() after changing data-duration yourself.

Overlapping and Clipped Spans

Spanning events whose times overlap are laid out side by side, each taking an equal share of the event column. A span that runs past the last visible hour (or past midnight) is clipped at the bottom of the grid, gets data-continues and a dashed end edge, and its accessible name gains “continues after the visible hours” (see data-label-continues).

Double-Booking

When two events occupy the same time slot, add data-overlap to the <hour-view> to display them side by side.

All-Day Events

Place all-day events in a <ul class="all-day-events"> above the hour list. In a generated grid, events without a <time datetime> are moved there for you.

Events

EventDetailDescription
day-view:event-click { date, time, text, element, category, duration } Fired when a <calendar-event> is clicked, or activated with Enter / Space while focused.
day-view:events-changed { events, source: 'property' } Fired after assigning the events property rebuilds the view.

JavaScript API

MemberDescription
events (get) The current <calendar-event> children as data: { time, text, category?, duration?, href? }[].
events (set) Replace every event and rebuild the view. Sets data-start-hour="auto". time is HH:MM or a full ISO datetime; omit it for an all-day event. Emits day-view:events-changed.
refresh() Re-measure and re-position spanning events now.

Two-Layer Rendering

The component uses two rendering layers:

LayerMechanismHandles
Grid CSS Grid + subgrid Hour rows, half-hour positioning, double-booking columns
Overlay JS absolute positioning Multi-hour spanning events (measured against grid rows)

Hour dividers use box-shadow instead of border to avoid gaps in the spanning calculations.

Progressive Enhancement

LayerWhat renders
HTML onlyOrdered list of hours with events — readable, semantic
+ CSSCategory colours and event blocks; the hours stay a numbered list
+ JSHour-grid layout and half-hour positioning (applied once upgraded, via data-upgraded), generated grids, multi-hour spanning, click events, keyboard navigation

Keyboard

KeyAction
Arrow DownMove focus to next event
Arrow UpMove focus to previous event
Home / EndMove focus to the first / last event
Enter / SpaceFire day-view:event-click for the focused event

Events are one roving tab stop: Tab enters the schedule on the last-focused event (the first one initially). Each event gets role="button", so it is announced as something that can be activated, and an accessible name from its time and title (author-supplied role / aria-label are kept). An event that contains its own links or controls gets role="group" instead, because a button cannot contain other controls. Links and buttons inside an event keep their own behaviour; Enter on them does not fire day-view:event-click.

Related

↑