Navigation

v2.1.0
Data display

Schedule

Events placed in time: a day or a week as hours down a rail, a month as weeks of lanes, or an agenda.

On this page

A schedule shows a day as hours down a rail, each event as tall as it lasts: a calendar's day view, the rooms of a conference, a clinic's appointments. The events are an ordered list, and each says its title and its time in words; the stylesheet places them on a scale of hours with a hairline at every hour and a label on each. Events that overlap stand side by side. There is no script and nothing is measured.

What lasts whole days stands in a band over the hours. A month shows each day's events in lanes, and an agenda lists them by day. A schedule view is the schedule a reader works, by the day, the week, the month or as an agenda, driven by the schedule behavior.

Schedule

<div class="card max-w(480) mx-auto">  <div class="schedule schedule-now" style="--schedule-from: 9; --schedule-to: 15; --now: 12.45">    <ol class="schedule-rail" aria-hidden="true">      <li>9 AM</li>      <li>10 AM</li>      <li>11 AM</li>      <li>12 PM</li>      <li>1 PM</li>      <li>2 PM</li>      <li>3 PM</li>    </ol>    <ol class="schedule-events" aria-label="Thursday 13 November">      <li class="schedule-event" style="--start: 9; --end: 9.5">        <p class="schedule-title">Standup</p>        <p class="schedule-time">          <time datetime="09:00">9:00</time> – <time datetime="09:30">9:30</time>        </p>      </li>      <li class="schedule-event" style="--start: 10; --end: 11.5; --lanes: 2">        <p class="schedule-title">Design review</p>        <p class="schedule-time">          <time datetime="10:00">10:00</time> – <time datetime="11:30">11:30</time>        </p>      </li>      <li class="schedule-event" style="--start: 10.5; --end: 12; --lane: 1; --lanes: 2">        <p class="schedule-title">Interview: platform engineer</p>        <p class="schedule-time">          <time datetime="10:30">10:30</time> – <time datetime="12:00">12:00</time>        </p>      </li>      <li class="schedule-event" style="--start: 12; --end: 12.25">        <p class="schedule-title">Check-in with Alan</p>        <p class="schedule-time">          <time datetime="12:00">12:00</time> – <time datetime="12:15">12:15</time>        </p>      </li>      <li class="schedule-event" style="--start: 12.75; --end: 13.75">        <p class="schedule-title">Lunch with Ada</p>        <p class="schedule-time">          <time datetime="12:45">12:45</time> – <time datetime="13:45">13:45</time>        </p>      </li>      <li class="schedule-event" style="--start: 14; --end: 14.5">        <p class="schedule-title">1:1 with Grace</p>        <p class="schedule-time">          <time datetime="14:00">14:00</time> – <time datetime="14:30">14:30</time>        </p>      </li>    </ol>  </div></div>
<div className="card max-w(480) mx-auto">  <div className="schedule schedule-now" style={{ '--schedule-from': '9', '--schedule-to': '15', '--now': '12.45' } as React.CSSProperties}>    <ol className="schedule-rail" aria-hidden="true">      <li>9 AM</li>      <li>10 AM</li>      <li>11 AM</li>      <li>12 PM</li>      <li>1 PM</li>      <li>2 PM</li>      <li>3 PM</li>    </ol>    <ol className="schedule-events" aria-label="Thursday 13 November">      <li className="schedule-event" style={{ '--start': '9', '--end': '9.5' } as React.CSSProperties}>        <p className="schedule-title">Standup</p>        <p className="schedule-time">          <time dateTime="09:00">9:00</time> – <time dateTime="09:30">9:30</time>        </p>      </li>      <li className="schedule-event" style={{ '--start': '10', '--end': '11.5', '--lanes': '2' } as React.CSSProperties}>        <p className="schedule-title">Design review</p>        <p className="schedule-time">          <time dateTime="10:00">10:00</time> – <time dateTime="11:30">11:30</time>        </p>      </li>      <li className="schedule-event" style={{ '--start': '10.5', '--end': '12', '--lane': '1', '--lanes': '2' } as React.CSSProperties}>        <p className="schedule-title">Interview: platform engineer</p>        <p className="schedule-time">          <time dateTime="10:30">10:30</time> – <time dateTime="12:00">12:00</time>        </p>      </li>      <li className="schedule-event" style={{ '--start': '12', '--end': '12.25' } as React.CSSProperties}>        <p className="schedule-title">Check-in with Alan</p>        <p className="schedule-time">          <time dateTime="12:00">12:00</time> – <time dateTime="12:15">12:15</time>        </p>      </li>      <li className="schedule-event" style={{ '--start': '12.75', '--end': '13.75' } as React.CSSProperties}>        <p className="schedule-title">Lunch with Ada</p>        <p className="schedule-time">          <time dateTime="12:45">12:45</time> – <time dateTime="13:45">13:45</time>        </p>      </li>      <li className="schedule-event" style={{ '--start': '14', '--end': '14.5' } as React.CSSProperties}>        <p className="schedule-title">1:1 with Grace</p>        <p className="schedule-time">          <time dateTime="14:00">14:00</time> – <time dateTime="14:30">14:30</time>        </p>      </li>    </ol>  </div></div>
<div class="card max-w(480) mx-auto">  <div class="schedule schedule-now" style="--schedule-from: 9; --schedule-to: 15; --now: 12.45">    <ol class="schedule-rail" aria-hidden="true">      <li>9 AM</li>      <li>10 AM</li>      <li>11 AM</li>      <li>12 PM</li>      <li>1 PM</li>      <li>2 PM</li>      <li>3 PM</li>    </ol>    <ol class="schedule-events" aria-label="Thursday 13 November">      <li class="schedule-event" style="--start: 9; --end: 9.5">        <p class="schedule-title">Standup</p>        <p class="schedule-time">          <time datetime="09:00">9:00</time> – <time datetime="09:30">9:30</time>        </p>      </li>      <li class="schedule-event" style="--start: 10; --end: 11.5; --lanes: 2">        <p class="schedule-title">Design review</p>        <p class="schedule-time">          <time datetime="10:00">10:00</time> – <time datetime="11:30">11:30</time>        </p>      </li>      <li class="schedule-event" style="--start: 10.5; --end: 12; --lane: 1; --lanes: 2">        <p class="schedule-title">Interview: platform engineer</p>        <p class="schedule-time">          <time datetime="10:30">10:30</time> – <time datetime="12:00">12:00</time>        </p>      </li>      <li class="schedule-event" style="--start: 12; --end: 12.25">        <p class="schedule-title">Check-in with Alan</p>        <p class="schedule-time">          <time datetime="12:00">12:00</time> – <time datetime="12:15">12:15</time>        </p>      </li>      <li class="schedule-event" style="--start: 12.75; --end: 13.75">        <p class="schedule-title">Lunch with Ada</p>        <p class="schedule-time">          <time datetime="12:45">12:45</time> – <time datetime="13:45">13:45</time>        </p>      </li>      <li class="schedule-event" style="--start: 14; --end: 14.5">        <p class="schedule-title">1:1 with Grace</p>        <p class="schedule-time">          <time datetime="14:00">14:00</time> – <time datetime="14:30">14:30</time>        </p>      </li>    </ol>  </div></div>
<template>  <div class="card max-w(480) mx-auto">    <div class="schedule schedule-now" style="--schedule-from: 9; --schedule-to: 15; --now: 12.45">      <ol class="schedule-rail" aria-hidden="true">        <li>9 AM</li>        <li>10 AM</li>        <li>11 AM</li>        <li>12 PM</li>        <li>1 PM</li>        <li>2 PM</li>        <li>3 PM</li>      </ol>      <ol class="schedule-events" aria-label="Thursday 13 November">        <li class="schedule-event" style="--start: 9; --end: 9.5">          <p class="schedule-title">Standup</p>          <p class="schedule-time">            <time datetime="09:00">9:00</time> – <time datetime="09:30">9:30</time>          </p>        </li>        <li class="schedule-event" style="--start: 10; --end: 11.5; --lanes: 2">          <p class="schedule-title">Design review</p>          <p class="schedule-time">            <time datetime="10:00">10:00</time> – <time datetime="11:30">11:30</time>          </p>        </li>        <li class="schedule-event" style="--start: 10.5; --end: 12; --lane: 1; --lanes: 2">          <p class="schedule-title">Interview: platform engineer</p>          <p class="schedule-time">            <time datetime="10:30">10:30</time> – <time datetime="12:00">12:00</time>          </p>        </li>        <li class="schedule-event" style="--start: 12; --end: 12.25">          <p class="schedule-title">Check-in with Alan</p>          <p class="schedule-time">            <time datetime="12:00">12:00</time> – <time datetime="12:15">12:15</time>          </p>        </li>        <li class="schedule-event" style="--start: 12.75; --end: 13.75">          <p class="schedule-title">Lunch with Ada</p>          <p class="schedule-time">            <time datetime="12:45">12:45</time> – <time datetime="13:45">13:45</time>          </p>        </li>        <li class="schedule-event" style="--start: 14; --end: 14.5">          <p class="schedule-title">1:1 with Grace</p>          <p class="schedule-time">            <time datetime="14:00">14:00</time> – <time datetime="14:30">14:30</time>          </p>        </li>      </ol>    </div>  </div></template>

#How an event gets its place

The hours run from --schedule-from to --schedule-to, set on the schedule, and each hour is --schedule-hour tall, 48px unless you say otherwise. Each schedule-event sets --start and --end in hours of the same clock, so half past ten is 10.5 and a quarter to two in the afternoon is 13.75. The event begins and ends at those hours, a pixel clear of the hairline over it and the one under it, so two events that meet keep a line between them.

schedule-rail holds one label for each hour from --schedule-from to --schedule-to, the last one included, and stands each on the middle of its hairline. Write the labels the way your readers tell time; the rail is 48px wide (--schedule-rail).

A whole day at 48px an hour is over 1,100 pixels tall. Show the hours that matter, or put the schedule in a scroll area and let it scroll.

#Events that overlap

Events that share time share the width. Give each of them --lanes, how many stand side by side there, and --lane, its place among them from 0 at the start. Above, the design review and the interview are two lanes of one stretch. Working out the lanes is a question of the data, not the drawing: whatever renders the list decides them, and the stylesheet only places.

#Short events

An event is a size container, so it reads its own height and its words follow:

  • From an hour at the default size, the title stands over the time.
  • Shorter, the title and the time share one line, centered in the event, and the time is left out of sight when the two do not fit.
  • With no room for a line, as for a quarter of an hour at the default size, the event is its tinted sheet alone. Its words stay in the list for assistive technology, and its place on the rail says when it is.

#Now and the current event

schedule-now on the schedule draws an ink line at --now, in hours like the events, with a dot where it meets the start of the day. The line passes under the events, so it never strikes through their words.

The event marked aria-current="true" is an ink sheet: the one in progress, or the one open beside the schedule.

#Several days

For a few days side by side, put each day's schedule-events in a schedule-day with a schedule-heading over it. The days share the width and the rail, and their headings and hours line up across them. Mark today's column aria-current="date": its heading takes the strong ink, and the line of now runs through it with its dot, and through the other days as a hairline.

Several days

<div class="card max-w(560) mx-auto">  <div class="schedule schedule-now" style="--schedule-from: 9; --schedule-to: 13; --now: 11.25">    <ol class="schedule-rail" aria-hidden="true">      <li>9 AM</li>      <li>10 AM</li>      <li>11 AM</li>      <li>12 PM</li>      <li>1 PM</li>    </ol>    <section class="schedule-day" aria-labelledby="day-12">      <h3 class="schedule-heading" id="day-12">Wed 12</h3>      <ol class="schedule-events">        <li class="schedule-event" style="--start: 9; --end: 10">          <p class="schedule-title">Roadmap</p>          <p class="schedule-time">            <time datetime="09:00">9:00</time> – <time datetime="10:00">10:00</time>          </p>        </li>        <li class="schedule-event" style="--start: 11; --end: 12.5">          <p class="schedule-title">Workshop</p>          <p class="schedule-time">            <time datetime="11:00">11:00</time> – <time datetime="12:30">12:30</time>          </p>        </li>      </ol>    </section>    <section class="schedule-day" aria-current="date" aria-labelledby="day-13">      <h3 class="schedule-heading" id="day-13">Thu 13</h3>      <ol class="schedule-events">        <li class="schedule-event" style="--start: 9; --end: 9.5">          <p class="schedule-title">Standup</p>          <p class="schedule-time">            <time datetime="09:00">9:00</time> – <time datetime="09:30">9:30</time>          </p>        </li>        <li class="schedule-event" style="--start: 10; --end: 11.5; --lanes: 2">          <p class="schedule-title">Design review</p>          <p class="schedule-time">            <time datetime="10:00">10:00</time> – <time datetime="11:30">11:30</time>          </p>        </li>        <li class="schedule-event" aria-current="true" style="--start: 10.5; --end: 12; --lane: 1; --lanes: 2">          <p class="schedule-title">Interview</p>          <p class="schedule-time">            <time datetime="10:30">10:30</time> – <time datetime="12:00">12:00</time>          </p>        </li>        <li class="schedule-event" style="--start: 12.25; --end: 13">          <p class="schedule-title">Lunch</p>          <p class="schedule-time">            <time datetime="12:15">12:15</time> – <time datetime="13:00">13:00</time>          </p>        </li>      </ol>    </section>    <section class="schedule-day" aria-labelledby="day-14">      <h3 class="schedule-heading" id="day-14">Fri 14</h3>      <ol class="schedule-events">        <li class="schedule-event" style="--start: 9.5; --end: 10.25">          <p class="schedule-title">Sync</p>          <p class="schedule-time">            <time datetime="09:30">9:30</time> – <time datetime="10:15">10:15</time>          </p>        </li>        <li class="schedule-event" style="--start: 11.5; --end: 13">          <p class="schedule-title">Offsite</p>          <p class="schedule-time">            <time datetime="11:30">11:30</time> – <time datetime="13:00">13:00</time>          </p>        </li>      </ol>    </section>  </div></div>
<div className="card max-w(560) mx-auto">  <div className="schedule schedule-now" style={{ '--schedule-from': '9', '--schedule-to': '13', '--now': '11.25' } as React.CSSProperties}>    <ol className="schedule-rail" aria-hidden="true">      <li>9 AM</li>      <li>10 AM</li>      <li>11 AM</li>      <li>12 PM</li>      <li>1 PM</li>    </ol>    <section className="schedule-day" aria-labelledby="day-12">      <h3 className="schedule-heading" id="day-12">Wed 12</h3>      <ol className="schedule-events">        <li className="schedule-event" style={{ '--start': '9', '--end': '10' } as React.CSSProperties}>          <p className="schedule-title">Roadmap</p>          <p className="schedule-time">            <time dateTime="09:00">9:00</time> – <time dateTime="10:00">10:00</time>          </p>        </li>        <li className="schedule-event" style={{ '--start': '11', '--end': '12.5' } as React.CSSProperties}>          <p className="schedule-title">Workshop</p>          <p className="schedule-time">            <time dateTime="11:00">11:00</time> – <time dateTime="12:30">12:30</time>          </p>        </li>      </ol>    </section>    <section className="schedule-day" aria-current="date" aria-labelledby="day-13">      <h3 className="schedule-heading" id="day-13">Thu 13</h3>      <ol className="schedule-events">        <li className="schedule-event" style={{ '--start': '9', '--end': '9.5' } as React.CSSProperties}>          <p className="schedule-title">Standup</p>          <p className="schedule-time">            <time dateTime="09:00">9:00</time> – <time dateTime="09:30">9:30</time>          </p>        </li>        <li className="schedule-event" style={{ '--start': '10', '--end': '11.5', '--lanes': '2' } as React.CSSProperties}>          <p className="schedule-title">Design review</p>          <p className="schedule-time">            <time dateTime="10:00">10:00</time> – <time dateTime="11:30">11:30</time>          </p>        </li>        <li className="schedule-event" aria-current="true" style={{ '--start': '10.5', '--end': '12', '--lane': '1', '--lanes': '2' } as React.CSSProperties}>          <p className="schedule-title">Interview</p>          <p className="schedule-time">            <time dateTime="10:30">10:30</time> – <time dateTime="12:00">12:00</time>          </p>        </li>        <li className="schedule-event" style={{ '--start': '12.25', '--end': '13' } as React.CSSProperties}>          <p className="schedule-title">Lunch</p>          <p className="schedule-time">            <time dateTime="12:15">12:15</time> – <time dateTime="13:00">13:00</time>          </p>        </li>      </ol>    </section>    <section className="schedule-day" aria-labelledby="day-14">      <h3 className="schedule-heading" id="day-14">Fri 14</h3>      <ol className="schedule-events">        <li className="schedule-event" style={{ '--start': '9.5', '--end': '10.25' } as React.CSSProperties}>          <p className="schedule-title">Sync</p>          <p className="schedule-time">            <time dateTime="09:30">9:30</time> – <time dateTime="10:15">10:15</time>          </p>        </li>        <li className="schedule-event" style={{ '--start': '11.5', '--end': '13' } as React.CSSProperties}>          <p className="schedule-title">Offsite</p>          <p className="schedule-time">            <time dateTime="11:30">11:30</time> – <time dateTime="13:00">13:00</time>          </p>        </li>      </ol>    </section>  </div></div>
<div class="card max-w(560) mx-auto">  <div class="schedule schedule-now" style="--schedule-from: 9; --schedule-to: 13; --now: 11.25">    <ol class="schedule-rail" aria-hidden="true">      <li>9 AM</li>      <li>10 AM</li>      <li>11 AM</li>      <li>12 PM</li>      <li>1 PM</li>    </ol>    <section class="schedule-day" aria-labelledby="day-12">      <h3 class="schedule-heading" id="day-12">Wed 12</h3>      <ol class="schedule-events">        <li class="schedule-event" style="--start: 9; --end: 10">          <p class="schedule-title">Roadmap</p>          <p class="schedule-time">            <time datetime="09:00">9:00</time> – <time datetime="10:00">10:00</time>          </p>        </li>        <li class="schedule-event" style="--start: 11; --end: 12.5">          <p class="schedule-title">Workshop</p>          <p class="schedule-time">            <time datetime="11:00">11:00</time> – <time datetime="12:30">12:30</time>          </p>        </li>      </ol>    </section>    <section class="schedule-day" aria-current="date" aria-labelledby="day-13">      <h3 class="schedule-heading" id="day-13">Thu 13</h3>      <ol class="schedule-events">        <li class="schedule-event" style="--start: 9; --end: 9.5">          <p class="schedule-title">Standup</p>          <p class="schedule-time">            <time datetime="09:00">9:00</time> – <time datetime="09:30">9:30</time>          </p>        </li>        <li class="schedule-event" style="--start: 10; --end: 11.5; --lanes: 2">          <p class="schedule-title">Design review</p>          <p class="schedule-time">            <time datetime="10:00">10:00</time> – <time datetime="11:30">11:30</time>          </p>        </li>        <li class="schedule-event" aria-current="true" style="--start: 10.5; --end: 12; --lane: 1; --lanes: 2">          <p class="schedule-title">Interview</p>          <p class="schedule-time">            <time datetime="10:30">10:30</time> – <time datetime="12:00">12:00</time>          </p>        </li>        <li class="schedule-event" style="--start: 12.25; --end: 13">          <p class="schedule-title">Lunch</p>          <p class="schedule-time">            <time datetime="12:15">12:15</time> – <time datetime="13:00">13:00</time>          </p>        </li>      </ol>    </section>    <section class="schedule-day" aria-labelledby="day-14">      <h3 class="schedule-heading" id="day-14">Fri 14</h3>      <ol class="schedule-events">        <li class="schedule-event" style="--start: 9.5; --end: 10.25">          <p class="schedule-title">Sync</p>          <p class="schedule-time">            <time datetime="09:30">9:30</time> – <time datetime="10:15">10:15</time>          </p>        </li>        <li class="schedule-event" style="--start: 11.5; --end: 13">          <p class="schedule-title">Offsite</p>          <p class="schedule-time">            <time datetime="11:30">11:30</time> – <time datetime="13:00">13:00</time>          </p>        </li>      </ol>    </section>  </div></div>
<template>  <div class="card max-w(560) mx-auto">    <div class="schedule schedule-now" style="--schedule-from: 9; --schedule-to: 13; --now: 11.25">      <ol class="schedule-rail" aria-hidden="true">        <li>9 AM</li>        <li>10 AM</li>        <li>11 AM</li>        <li>12 PM</li>        <li>1 PM</li>      </ol>      <section class="schedule-day" aria-labelledby="day-12">        <h3 class="schedule-heading" id="day-12">Wed 12</h3>        <ol class="schedule-events">          <li class="schedule-event" style="--start: 9; --end: 10">            <p class="schedule-title">Roadmap</p>            <p class="schedule-time">              <time datetime="09:00">9:00</time> – <time datetime="10:00">10:00</time>            </p>          </li>          <li class="schedule-event" style="--start: 11; --end: 12.5">            <p class="schedule-title">Workshop</p>            <p class="schedule-time">              <time datetime="11:00">11:00</time> – <time datetime="12:30">12:30</time>            </p>          </li>        </ol>      </section>      <section class="schedule-day" aria-current="date" aria-labelledby="day-13">        <h3 class="schedule-heading" id="day-13">Thu 13</h3>        <ol class="schedule-events">          <li class="schedule-event" style="--start: 9; --end: 9.5">            <p class="schedule-title">Standup</p>            <p class="schedule-time">              <time datetime="09:00">9:00</time> – <time datetime="09:30">9:30</time>            </p>          </li>          <li class="schedule-event" style="--start: 10; --end: 11.5; --lanes: 2">            <p class="schedule-title">Design review</p>            <p class="schedule-time">              <time datetime="10:00">10:00</time> – <time datetime="11:30">11:30</time>            </p>          </li>          <li class="schedule-event" aria-current="true" style="--start: 10.5; --end: 12; --lane: 1; --lanes: 2">            <p class="schedule-title">Interview</p>            <p class="schedule-time">              <time datetime="10:30">10:30</time> – <time datetime="12:00">12:00</time>            </p>          </li>          <li class="schedule-event" style="--start: 12.25; --end: 13">            <p class="schedule-title">Lunch</p>            <p class="schedule-time">              <time datetime="12:15">12:15</time> – <time datetime="13:00">13:00</time>            </p>          </li>        </ol>      </section>      <section class="schedule-day" aria-labelledby="day-14">        <h3 class="schedule-heading" id="day-14">Fri 14</h3>        <ol class="schedule-events">          <li class="schedule-event" style="--start: 9.5; --end: 10.25">            <p class="schedule-title">Sync</p>            <p class="schedule-time">              <time datetime="09:30">9:30</time> – <time datetime="10:15">10:15</time>            </p>          </li>          <li class="schedule-event" style="--start: 11.5; --end: 13">            <p class="schedule-title">Offsite</p>            <p class="schedule-time">              <time datetime="11:30">11:30</time> – <time datetime="13:00">13:00</time>            </p>          </li>        </ol>      </section>    </div>  </div></template>

Three to five days read well in a card; a week wants the width of a page. In a narrow column each day keeps its share and titles end in an ellipsis.

#Events that open something

When an event opens its details, put schedule-event on a link or a button inside the list item instead of on the item. It is placed the same way, takes a step firmer tint under the pointer and draws the focus ring for the keyboard.

<li>  <a class="schedule-event" href="/events/design-review" style="--start: 10; --end: 11.5">    <span class="schedule-title">Design review</span>    <span class="schedule-time"><time datetime="10:00">10:00</time> – <time datetime="11:30">11:30</time></span>  </a></li>

#Whole days

An event that lasts a day or more stands in schedule-allday, a band under the headings and over the hours, with its name, such as "All day", in the rail's column. Each event in it is a schedule-event-lane: it covers --span days from day --column, on lane --lane. The band runs across the days, so each schedule-day names its column with --column and the schedule says how many there are in --schedule-days.

Whole days

<div class="card max-w(560) mx-auto">  <div class="card-body">    <div class="schedule" style="--schedule-from: 9; --schedule-to: 13; --schedule-days: 3">      <ol class="schedule-rail" aria-hidden="true">        <li>9 AM</li>        <li>10 AM</li>        <li>11 AM</li>        <li>12 PM</li>        <li>1 PM</li>      </ol>      <div class="schedule-day" style="--column: 1">        <h3 class="schedule-heading">Wed 12</h3>        <ol class="schedule-events" aria-label="Wednesday 12 November">          <li class="schedule-event" style="--start: 9.5; --end: 10.5">            <p class="schedule-title">Planning</p>            <p class="schedule-time">9:30 – 10:30</p>          </li>        </ol>      </div>      <div class="schedule-day" style="--column: 2" aria-current="date">        <h3 class="schedule-heading">Thu 13</h3>        <ol class="schedule-events" aria-label="Thursday 13 November">          <li class="schedule-event" style="--start: 11; --end: 12">            <p class="schedule-title">Design review</p>            <p class="schedule-time">11:00 – 12:00</p>          </li>        </ol>      </div>      <div class="schedule-day" style="--column: 3">        <h3 class="schedule-heading">Fri 14</h3>        <ol class="schedule-events" aria-label="Friday 14 November"></ol>      </div>      <div class="schedule-allday" role="group" aria-label="All day">        <span class="schedule-allday-label" aria-hidden="true">All day</span>        <p class="schedule-event schedule-event-lane" style="--column: 2; --span: 2">          <span class="schedule-title">Offsite in Lisbon</span>        </p>        <p class="schedule-event schedule-event-lane schedule-event-continued" style="--column: 1; --lane: 1">          <span class="schedule-title">On call</span>        </p>      </div>    </div>  </div></div>
<div className="card max-w(560) mx-auto">  <div className="card-body">    <div className="schedule" style={{ '--schedule-from': '9', '--schedule-to': '13', '--schedule-days': '3' } as React.CSSProperties}>      <ol className="schedule-rail" aria-hidden="true">        <li>9 AM</li>        <li>10 AM</li>        <li>11 AM</li>        <li>12 PM</li>        <li>1 PM</li>      </ol>      <div className="schedule-day" style={{ '--column': '1' } as React.CSSProperties}>        <h3 className="schedule-heading">Wed 12</h3>        <ol className="schedule-events" aria-label="Wednesday 12 November">          <li className="schedule-event" style={{ '--start': '9.5', '--end': '10.5' } as React.CSSProperties}>            <p className="schedule-title">Planning</p>            <p className="schedule-time">9:30 – 10:30</p>          </li>        </ol>      </div>      <div className="schedule-day" style={{ '--column': '2' } as React.CSSProperties} aria-current="date">        <h3 className="schedule-heading">Thu 13</h3>        <ol className="schedule-events" aria-label="Thursday 13 November">          <li className="schedule-event" style={{ '--start': '11', '--end': '12' } as React.CSSProperties}>            <p className="schedule-title">Design review</p>            <p className="schedule-time">11:00 – 12:00</p>          </li>        </ol>      </div>      <div className="schedule-day" style={{ '--column': '3' } as React.CSSProperties}>        <h3 className="schedule-heading">Fri 14</h3>        <ol className="schedule-events" aria-label="Friday 14 November"></ol>      </div>      <div className="schedule-allday" role="group" aria-label="All day">        <span className="schedule-allday-label" aria-hidden="true">All day</span>        <p className="schedule-event schedule-event-lane" style={{ '--column': '2', '--span': '2' } as React.CSSProperties}>          <span className="schedule-title">Offsite in Lisbon</span>        </p>        <p className="schedule-event schedule-event-lane schedule-event-continued" style={{ '--column': '1', '--lane': '1' } as React.CSSProperties}>          <span className="schedule-title">On call</span>        </p>      </div>    </div>  </div></div>
<div class="card max-w(560) mx-auto">  <div class="card-body">    <div class="schedule" style="--schedule-from: 9; --schedule-to: 13; --schedule-days: 3">      <ol class="schedule-rail" aria-hidden="true">        <li>9 AM</li>        <li>10 AM</li>        <li>11 AM</li>        <li>12 PM</li>        <li>1 PM</li>      </ol>      <div class="schedule-day" style="--column: 1">        <h3 class="schedule-heading">Wed 12</h3>        <ol class="schedule-events" aria-label="Wednesday 12 November">          <li class="schedule-event" style="--start: 9.5; --end: 10.5">            <p class="schedule-title">Planning</p>            <p class="schedule-time">9:30 – 10:30</p>          </li>        </ol>      </div>      <div class="schedule-day" style="--column: 2" aria-current="date">        <h3 class="schedule-heading">Thu 13</h3>        <ol class="schedule-events" aria-label="Thursday 13 November">          <li class="schedule-event" style="--start: 11; --end: 12">            <p class="schedule-title">Design review</p>            <p class="schedule-time">11:00 – 12:00</p>          </li>        </ol>      </div>      <div class="schedule-day" style="--column: 3">        <h3 class="schedule-heading">Fri 14</h3>        <ol class="schedule-events" aria-label="Friday 14 November"></ol>      </div>      <div class="schedule-allday" role="group" aria-label="All day">        <span class="schedule-allday-label" aria-hidden="true">All day</span>        <p class="schedule-event schedule-event-lane" style="--column: 2; --span: 2">          <span class="schedule-title">Offsite in Lisbon</span>        </p>        <p class="schedule-event schedule-event-lane schedule-event-continued" style="--column: 1; --lane: 1">          <span class="schedule-title">On call</span>        </p>      </div>    </div>  </div></div>
<template>  <div class="card max-w(560) mx-auto">    <div class="card-body">      <div class="schedule" style="--schedule-from: 9; --schedule-to: 13; --schedule-days: 3">        <ol class="schedule-rail" aria-hidden="true">          <li>9 AM</li>          <li>10 AM</li>          <li>11 AM</li>          <li>12 PM</li>          <li>1 PM</li>        </ol>        <div class="schedule-day" style="--column: 1">          <h3 class="schedule-heading">Wed 12</h3>          <ol class="schedule-events" aria-label="Wednesday 12 November">            <li class="schedule-event" style="--start: 9.5; --end: 10.5">              <p class="schedule-title">Planning</p>              <p class="schedule-time">9:30 – 10:30</p>            </li>          </ol>        </div>        <div class="schedule-day" style="--column: 2" aria-current="date">          <h3 class="schedule-heading">Thu 13</h3>          <ol class="schedule-events" aria-label="Thursday 13 November">            <li class="schedule-event" style="--start: 11; --end: 12">              <p class="schedule-title">Design review</p>              <p class="schedule-time">11:00 – 12:00</p>            </li>          </ol>        </div>        <div class="schedule-day" style="--column: 3">          <h3 class="schedule-heading">Fri 14</h3>          <ol class="schedule-events" aria-label="Friday 14 November"></ol>        </div>        <div class="schedule-allday" role="group" aria-label="All day">          <span class="schedule-allday-label" aria-hidden="true">All day</span>          <p class="schedule-event schedule-event-lane" style="--column: 2; --span: 2">            <span class="schedule-title">Offsite in Lisbon</span>          </p>          <p class="schedule-event schedule-event-lane schedule-event-continued" style="--column: 1; --lane: 1">            <span class="schedule-title">On call</span>          </p>        </div>      </div>    </div>  </div></template>

A piece of an event that began before what is shown is schedule-event-continued, and one that goes on after it is schedule-event-continues: in a lane its start or its end is square and runs to the edge, and on the hours, past midnight, its top or its bottom. A piece that is not the start has no bar.

#Category

schedule-event-category colors an event with the category set on it or around it: its sheet takes the category's surface, its bar the category's mark and its words the category's text. A calendar of several teams or projects tells them apart this way; the title still says what the event is.

Category

<div class="card max-w(480) mx-auto">  <div class="card-body">    <div class="schedule" style="--schedule-from: 9; --schedule-to: 12">      <ol class="schedule-rail" aria-hidden="true">        <li>9 AM</li>        <li>10 AM</li>        <li>11 AM</li>        <li>12 PM</li>      </ol>      <ol class="schedule-events" aria-label="Thursday 13 November">        <li class="schedule-event schedule-event-category category-violet" style="--start: 9; --end: 10; --lanes: 2">          <p class="schedule-title">User interviews</p>          <p class="schedule-time">9:00 – 10:00</p>        </li>        <li class="schedule-event schedule-event-category category-teal" style="--start: 9.5; --end: 11; --lane: 1; --lanes: 2">          <p class="schedule-title">Token audit</p>          <p class="schedule-time">9:30 – 11:00</p>        </li>        <li class="schedule-event schedule-event-category category-orange" style="--start: 11; --end: 11.75">          <p class="schedule-title">Launch check-in</p>          <p class="schedule-time">11:00 – 11:45</p>        </li>      </ol>    </div>  </div></div>
<div className="card max-w(480) mx-auto">  <div className="card-body">    <div className="schedule" style={{ '--schedule-from': '9', '--schedule-to': '12' } as React.CSSProperties}>      <ol className="schedule-rail" aria-hidden="true">        <li>9 AM</li>        <li>10 AM</li>        <li>11 AM</li>        <li>12 PM</li>      </ol>      <ol className="schedule-events" aria-label="Thursday 13 November">        <li className="schedule-event schedule-event-category category-violet" style={{ '--start': '9', '--end': '10', '--lanes': '2' } as React.CSSProperties}>          <p className="schedule-title">User interviews</p>          <p className="schedule-time">9:00 – 10:00</p>        </li>        <li className="schedule-event schedule-event-category category-teal" style={{ '--start': '9.5', '--end': '11', '--lane': '1', '--lanes': '2' } as React.CSSProperties}>          <p className="schedule-title">Token audit</p>          <p className="schedule-time">9:30 – 11:00</p>        </li>        <li className="schedule-event schedule-event-category category-orange" style={{ '--start': '11', '--end': '11.75' } as React.CSSProperties}>          <p className="schedule-title">Launch check-in</p>          <p className="schedule-time">11:00 – 11:45</p>        </li>      </ol>    </div>  </div></div>
<div class="card max-w(480) mx-auto">  <div class="card-body">    <div class="schedule" style="--schedule-from: 9; --schedule-to: 12">      <ol class="schedule-rail" aria-hidden="true">        <li>9 AM</li>        <li>10 AM</li>        <li>11 AM</li>        <li>12 PM</li>      </ol>      <ol class="schedule-events" aria-label="Thursday 13 November">        <li class="schedule-event schedule-event-category category-violet" style="--start: 9; --end: 10; --lanes: 2">          <p class="schedule-title">User interviews</p>          <p class="schedule-time">9:00 – 10:00</p>        </li>        <li class="schedule-event schedule-event-category category-teal" style="--start: 9.5; --end: 11; --lane: 1; --lanes: 2">          <p class="schedule-title">Token audit</p>          <p class="schedule-time">9:30 – 11:00</p>        </li>        <li class="schedule-event schedule-event-category category-orange" style="--start: 11; --end: 11.75">          <p class="schedule-title">Launch check-in</p>          <p class="schedule-time">11:00 – 11:45</p>        </li>      </ol>    </div>  </div></div>
<template>  <div class="card max-w(480) mx-auto">    <div class="card-body">      <div class="schedule" style="--schedule-from: 9; --schedule-to: 12">        <ol class="schedule-rail" aria-hidden="true">          <li>9 AM</li>          <li>10 AM</li>          <li>11 AM</li>          <li>12 PM</li>        </ol>        <ol class="schedule-events" aria-label="Thursday 13 November">          <li class="schedule-event schedule-event-category category-violet" style="--start: 9; --end: 10; --lanes: 2">            <p class="schedule-title">User interviews</p>            <p class="schedule-time">9:00 – 10:00</p>          </li>          <li class="schedule-event schedule-event-category category-teal" style="--start: 9.5; --end: 11; --lane: 1; --lanes: 2">            <p class="schedule-title">Token audit</p>            <p class="schedule-time">9:30 – 11:00</p>          </li>          <li class="schedule-event schedule-event-category category-orange" style="--start: 11; --end: 11.75">            <p class="schedule-title">Launch check-in</p>            <p class="schedule-time">11:00 – 11:45</p>          </li>        </ol>      </div>    </div>  </div></template>

#A month

schedule-month is a month as weeks of seven days. Each schedule-week writes a day, then the events that start on it, then its more button, so a screen reader meets them in the order of the days; the stylesheet places each in its column and lane. The day's number, schedule-date-number, is a round button that opens the day, ink for today. A day shows --lanes events, three by default, and a schedule-more button for the rest, which opens a popover that lists them. A short event in a month is plain, schedule-event-plain: a dot, its time and its title, without a sheet.

In a room narrower than 36rem the lanes give way: each day shows a dot for each of its events, three at most, under its number, which opens the day. Nothing is squeezed into seven narrow columns of text.

schedule-agenda lists the same events by day, the date at the start of each row and its events in a schedule-list beside it, or over them in a narrow room. It suits a phone, a printout and a reader who would rather read than look.

The month and the agenda are written from the events, so they come from the behavior or a framework component, as in the view below.

#A schedule to work

A schedule-view puts a header of controls over a body the schedule behavior writes: today, previous and next, the period's name and a switch between day, week, month and agenda. Previous and next move by the view's period, a day's number opens that day, and the period's name is announced when it changes. On a narrow room the name takes a line of its own.

A schedule to work

<section class="schedule-view" id="team" aria-labelledby="team-title">  <div class="schedule-view-header">    <button type="button" class="btn btn-sm schedule-view-today">Today</button>    <button type="button" class="btn btn-sm btn-square btn-quiet schedule-view-previous" aria-label="Previous">      <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">        <path d="M6 3.5L10.3586 7.8586A0.2 0.2 0 0 1 10.3586 8.1414L6 12.5" transform="rotate(180 8 8)" />      </svg>    </button>    <button type="button" class="btn btn-sm btn-square btn-quiet schedule-view-next" aria-label="Next">      <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">        <path d="M6 3.5L10.3586 7.8586A0.2 0.2 0 0 1 10.3586 8.1414L6 12.5" />      </svg>    </button>    <h2 class="schedule-view-title" id="team-title" aria-live="polite">November 2026</h2>    <div class="segmented segmented-sm schedule-view-switch" role="radiogroup" aria-label="View">      <label class="segmented-item">        <input type="radio" class="segmented-input" name="team-view" value="day">Day      </label>      <label class="segmented-item">        <input type="radio" class="segmented-input" name="team-view" value="week">Week      </label>      <label class="segmented-item">        <input type="radio" class="segmented-input" name="team-view" value="month" checked>Month      </label>      <label class="segmented-item">        <input type="radio" class="segmented-input" name="team-view" value="agenda">Agenda      </label>    </div>  </div>  <div class="schedule-view-body"></div></section><script>addEventListener('DOMContentLoaded', function () {MasterUI.schedule(document.getElementById('team'), {  today: '2026-11-13', locale: 'en-US', weekStart: 1, value: { date: '2026-11-13', view: 'month' },  events: [    { id: 'review', title: 'Design review', start: '2026-11-03T10:00', end: '2026-11-03T11:30', category: 'violet' },    { id: 'offsite', title: 'Offsite', start: '2026-11-07', end: '2026-11-11', allDay: true, category: 'teal' },    { id: 'deploy', title: 'Deploy window', start: '2026-11-12T22:00', end: '2026-11-13T02:00', category: 'red' },    { id: 'launch', title: 'Launch', start: '2026-11-13', end: '2026-11-14', allDay: true, category: 'orange' },    { id: 'standup', title: 'Standup', start: '2026-11-13T09:00', end: '2026-11-13T09:15' },    { id: 'lunch', title: 'Team lunch', start: '2026-11-13T12:00', end: '2026-11-13T13:00', category: 'green' },    { id: 'call', title: 'Customer call', start: '2026-11-13T14:00', end: '2026-11-13T15:00', category: 'blue' },    { id: 'retro', title: 'Retro', start: '2026-11-13T17:00', end: '2026-11-13T17:45' },    { id: 'planning', title: 'Planning', start: '2026-11-17T09:30', end: '2026-11-17T11:00', category: 'blue' },    { id: 'conference', title: 'Conference', start: '2026-11-19', end: '2026-11-22', allDay: true, category: 'violet' }  ]})})</script><script type="module">  import { attach } from '@master/ui/behaviors'  attach()</script>
import { useEffect, useRef } from 'react'import { attach, schedule } from '@master/ui/behaviors'import ChevronLeftIcon from '@master/icons-react/native/16/soft/chevron-left'import ChevronRightIcon from '@master/icons-react/native/16/soft/chevron-right'export function Example() {  const root = useRef<HTMLElement>(null)  useEffect(() => {    const detach = [      attach(root.current!),      schedule(document.getElementById('team')!, {        today: '2026-11-13', locale: 'en-US', weekStart: 1, value: { date: '2026-11-13', view: 'month' },        events: [          { id: 'review', title: 'Design review', start: '2026-11-03T10:00', end: '2026-11-03T11:30', category: 'violet' },          { id: 'offsite', title: 'Offsite', start: '2026-11-07', end: '2026-11-11', allDay: true, category: 'teal' },          { id: 'deploy', title: 'Deploy window', start: '2026-11-12T22:00', end: '2026-11-13T02:00', category: 'red' },          { id: 'launch', title: 'Launch', start: '2026-11-13', end: '2026-11-14', allDay: true, category: 'orange' },          { id: 'standup', title: 'Standup', start: '2026-11-13T09:00', end: '2026-11-13T09:15' },          { id: 'lunch', title: 'Team lunch', start: '2026-11-13T12:00', end: '2026-11-13T13:00', category: 'green' },          { id: 'call', title: 'Customer call', start: '2026-11-13T14:00', end: '2026-11-13T15:00', category: 'blue' },          { id: 'retro', title: 'Retro', start: '2026-11-13T17:00', end: '2026-11-13T17:45' },          { id: 'planning', title: 'Planning', start: '2026-11-17T09:30', end: '2026-11-17T11:00', category: 'blue' },          { id: 'conference', title: 'Conference', start: '2026-11-19', end: '2026-11-22', allDay: true, category: 'violet' }        ]      }),    ]    return () => detach.forEach(stop => stop())  }, [])  return (    <section ref={root} className="schedule-view" id="team" aria-labelledby="team-title">      <div className="schedule-view-header">        <button type="button" className="btn btn-sm schedule-view-today">Today</button>        <button type="button" className="btn btn-sm btn-square btn-quiet schedule-view-previous" aria-label="Previous">          <ChevronLeftIcon className="icon" />        </button>        <button type="button" className="btn btn-sm btn-square btn-quiet schedule-view-next" aria-label="Next">          <ChevronRightIcon className="icon" />        </button>        <h2 className="schedule-view-title" id="team-title" aria-live="polite">November 2026</h2>        <div className="segmented segmented-sm schedule-view-switch" role="radiogroup" aria-label="View">          <label className="segmented-item">            <input type="radio" className="segmented-input" name="team-view" value="day" />Day          </label>          <label className="segmented-item">            <input type="radio" className="segmented-input" name="team-view" value="week" />Week          </label>          <label className="segmented-item">            <input type="radio" className="segmented-input" name="team-view" value="month" defaultChecked />Month          </label>          <label className="segmented-item">            <input type="radio" className="segmented-input" name="team-view" value="agenda" />Agenda          </label>        </div>      </div>      <div className="schedule-view-body"></div>    </section>  )}
<script>  import { attach, schedule } from '@master/ui/behaviors'  import ChevronLeftIcon from '@master/icons-svelte/native/16/soft/chevron-left'  import ChevronRightIcon from '@master/icons-svelte/native/16/soft/chevron-right'  function mounted(root) {    const detach = [      attach(root),      schedule(document.getElementById('team'), {        today: '2026-11-13', locale: 'en-US', weekStart: 1, value: { date: '2026-11-13', view: 'month' },        events: [          { id: 'review', title: 'Design review', start: '2026-11-03T10:00', end: '2026-11-03T11:30', category: 'violet' },          { id: 'offsite', title: 'Offsite', start: '2026-11-07', end: '2026-11-11', allDay: true, category: 'teal' },          { id: 'deploy', title: 'Deploy window', start: '2026-11-12T22:00', end: '2026-11-13T02:00', category: 'red' },          { id: 'launch', title: 'Launch', start: '2026-11-13', end: '2026-11-14', allDay: true, category: 'orange' },          { id: 'standup', title: 'Standup', start: '2026-11-13T09:00', end: '2026-11-13T09:15' },          { id: 'lunch', title: 'Team lunch', start: '2026-11-13T12:00', end: '2026-11-13T13:00', category: 'green' },          { id: 'call', title: 'Customer call', start: '2026-11-13T14:00', end: '2026-11-13T15:00', category: 'blue' },          { id: 'retro', title: 'Retro', start: '2026-11-13T17:00', end: '2026-11-13T17:45' },          { id: 'planning', title: 'Planning', start: '2026-11-17T09:30', end: '2026-11-17T11:00', category: 'blue' },          { id: 'conference', title: 'Conference', start: '2026-11-19', end: '2026-11-22', allDay: true, category: 'violet' }        ]      }),    ]    return () => detach.forEach(stop => stop())  }</script><section class="schedule-view" id="team" aria-labelledby="team-title" {@attach mounted}>  <div class="schedule-view-header">    <button type="button" class="btn btn-sm schedule-view-today">Today</button>    <button type="button" class="btn btn-sm btn-square btn-quiet schedule-view-previous" aria-label="Previous">      <ChevronLeftIcon class="icon" />    </button>    <button type="button" class="btn btn-sm btn-square btn-quiet schedule-view-next" aria-label="Next">      <ChevronRightIcon class="icon" />    </button>    <h2 class="schedule-view-title" id="team-title" aria-live="polite">November 2026</h2>    <div class="segmented segmented-sm schedule-view-switch" role="radiogroup" aria-label="View">      <label class="segmented-item">        <input type="radio" class="segmented-input" name="team-view" value="day">Day      </label>      <label class="segmented-item">        <input type="radio" class="segmented-input" name="team-view" value="week">Week      </label>      <label class="segmented-item">        <input type="radio" class="segmented-input" name="team-view" value="month" checked>Month      </label>      <label class="segmented-item">        <input type="radio" class="segmented-input" name="team-view" value="agenda">Agenda      </label>    </div>  </div>  <div class="schedule-view-body"></div></section>
<script setup>import { onMounted, onUnmounted, ref } from 'vue'import { attach, schedule } from '@master/ui/behaviors'import ChevronLeftIcon from '@master/icons-vue/native/16/soft/chevron-left'import ChevronRightIcon from '@master/icons-vue/native/16/soft/chevron-right'const root = ref(null)let detach = []onMounted(() => {  detach = [    attach(root.value),    schedule(document.getElementById('team'), {      today: '2026-11-13', locale: 'en-US', weekStart: 1, value: { date: '2026-11-13', view: 'month' },      events: [        { id: 'review', title: 'Design review', start: '2026-11-03T10:00', end: '2026-11-03T11:30', category: 'violet' },        { id: 'offsite', title: 'Offsite', start: '2026-11-07', end: '2026-11-11', allDay: true, category: 'teal' },        { id: 'deploy', title: 'Deploy window', start: '2026-11-12T22:00', end: '2026-11-13T02:00', category: 'red' },        { id: 'launch', title: 'Launch', start: '2026-11-13', end: '2026-11-14', allDay: true, category: 'orange' },        { id: 'standup', title: 'Standup', start: '2026-11-13T09:00', end: '2026-11-13T09:15' },        { id: 'lunch', title: 'Team lunch', start: '2026-11-13T12:00', end: '2026-11-13T13:00', category: 'green' },        { id: 'call', title: 'Customer call', start: '2026-11-13T14:00', end: '2026-11-13T15:00', category: 'blue' },        { id: 'retro', title: 'Retro', start: '2026-11-13T17:00', end: '2026-11-13T17:45' },        { id: 'planning', title: 'Planning', start: '2026-11-17T09:30', end: '2026-11-17T11:00', category: 'blue' },        { id: 'conference', title: 'Conference', start: '2026-11-19', end: '2026-11-22', allDay: true, category: 'violet' }      ]    }),  ]})onUnmounted(() => detach.forEach(stop => stop()))</script><template>  <section ref="root" class="schedule-view" id="team" aria-labelledby="team-title">    <div class="schedule-view-header">      <button type="button" class="btn btn-sm schedule-view-today">Today</button>      <button type="button" class="btn btn-sm btn-square btn-quiet schedule-view-previous" aria-label="Previous">        <ChevronLeftIcon class="icon" />      </button>      <button type="button" class="btn btn-sm btn-square btn-quiet schedule-view-next" aria-label="Next">        <ChevronRightIcon class="icon" />      </button>      <h2 class="schedule-view-title" id="team-title" aria-live="polite">November 2026</h2>      <div class="segmented segmented-sm schedule-view-switch" role="radiogroup" aria-label="View">        <label class="segmented-item">          <input type="radio" class="segmented-input" name="team-view" value="day">Day        </label>        <label class="segmented-item">          <input type="radio" class="segmented-input" name="team-view" value="week">Week        </label>        <label class="segmented-item">          <input type="radio" class="segmented-input" name="team-view" value="month" checked>Month        </label>        <label class="segmented-item">          <input type="radio" class="segmented-input" name="team-view" value="agenda">Agenda        </label>      </div>    </div>    <div class="schedule-view-body"></div>  </section></template>
Move by a month, open a day from its number, or switch to the week or the agenda.

#The events

Each event has a stable id, a title, a start and an end. An all-day event has allDay: true and days for its ends, YYYY-MM-DD; another has local times, YYYY-MM-DDTHH:mm. The end is exclusive: an all-day event on the 13th alone ends on the 14th, and an event that ends at midnight ends with the day before. category names a palette, such as blue for category-blue, and href makes the event a link; without one it is a button whose value is its id, which the page listens to.

Times are already in the zone the schedule is shown in, and a repeating event arrives as its occurrences: time zones and repeats are the application's to resolve. Days are counted with the calendar, kept at noon, so a daylight-saving change never moves an all-day event to the day before. The view does not edit, move or store events; it shows them and says which one was pressed.

#The behavior

app.js
import { schedule } from '@master/ui/behaviors/schedule.js'const team = schedule(document.querySelector('.schedule-view'), { events, today: '2026-11-13' })team.value // { date: '2026-11-13', view: 'month' }
OptionDefault
events[]The events, as above
valuetoday's monthThe day and the view to show first: { date, view }, the view one of day, week, month or agenda
todaythe browser'sToday, as YYYY-MM-DD; give it when a server renders the schedule, so both sides agree
localethe page's langA BCP 47 tag for the names of days and months
weekStartthe locale'sThe first day of a week, 0 for Sunday to 6 for Saturday
lanes3How many events a day of a month shows before the rest go behind its more button
from, to8, 18The hours a day or a week shows at least; they reach further for an earlier or a later event
messagesEnglishThe band's name, the more button's words and name, and the empty agenda's sentence
drawnoneTakes over writing the title and the body, for a renderer that writes them itself

The reader's moves dispatch input and change from the root; the function it returns has a value to read and to set, and setting it dispatches nothing. scheduleLayout(value, options) returns what a view shows as data, the weeks with each event's lane, the hours with each event's place, the band and the agenda's days, so a server, a framework and the behavior lay out the same events the same way.

#Schedule, gantt or calendar

A schedule is for events placed in time: the hours of a day read down, or the days of a month. Spans of a plan on one shared scale, one row to each thing, are a gantt. A month to pick a day from, or a range of days, is a calendar, and moments in the order they happened are a timeline.

#Accessibility

  • Write the events as an <ol> in order of time, and name it: with aria-label for one day, or with the day's heading through aria-labelledby on its schedule-day.
  • Each event says its title and its time in words, with <time datetime> for the hours, so it reads "Design review, 10:00 to 11:30" without the drawing. The rail is a picture of the same scale: hide it with aria-hidden="true".
  • The current event and today are marked with aria-current, which a screen reader announces. The line of now is drawn by the stylesheet; say the time in words where it matters.
  • In forced colors each event is outlined, the current one is filled with the highlight color, and the hairlines and the line of now keep the system's colors.
  • A month is not a date grid: its days are numbers that open a day and its events are links or buttons, each named with its title and when it is. A more button says how many events it lists and on which day. A category's color is never the only way an event is told apart.
  • The view's controls keep focus as they move; a day's number, which leaves with the month, hands focus to the name of the day it opened.
  • Name the time zone the hours are in near the title, such as "Times in Taipei (GMT+8)", wherever a reader may be in another zone: the rail and the events say only the time on the clock.

#React, Svelte and Vue

The schedule component writes the period from scheduleLayout(), so the first HTML a server sends holds it, and attaches the behavior, which answers the header and the day numbers. Its value is { date, view }, and pressing an event without an href is heard as onEventClick, or eventClick in Vue. Give today and locale when it is rendered on a server. Copy it into the project with npx master-ui add schedule; React, Svelte and Vue says how the components are built and used.

ui/schedule.tsx
'use client'import { useId, useMemo, useState, type ComponentProps, type CSSProperties } from 'react'import { schedule, scheduleLayout, type ScheduleEvent, type ScheduleItem, type ScheduleMessages, type ScheduleValue } from '@master/ui/behaviors/schedule.js'import { useBehavior } from './use-behavior'export type { ScheduleEvent, ScheduleValue }/** The words of the header, in the page's language. */export interface ScheduleLabels {  today?: string  previous?: string  next?: string  /** The name of the view switch. */  view?: string  day?: string  week?: string  month?: string  agenda?: string}export interface ScheduleProps extends Omit<ComponentProps<'section'>, 'defaultValue' | 'children' | 'ref'> {  events: ScheduleEvent[]  /** The day and the view on show. Today's month by default. */  value?: ScheduleValue  defaultValue?: ScheduleValue  onValueChange?: (value: ScheduleValue) => void  /** An event without an `href` is a button: this hears it pressed. */  onEventClick?: (event: ScheduleEvent) => void  /** Today, as `YYYY-MM-DD`. Give it when the schedule is rendered on a server, so both sides agree. */  today?: string  /** A BCP 47 tag for the names. Give it when the schedule is rendered on a server. */  locale?: string  /** The first day of a week, 0 for Sunday to 6 for Saturday. The locale's own by default. */  weekStart?: number  /** How many events a day of a month shows before the rest go behind its more button. */  lanes?: number  /** The hours a day or a week shows at least. */  from?: number  to?: number  messages?: ScheduleMessages  labels?: ScheduleLabels}const chevron = (turn?: number) => (  <svg className="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M6 3.5L10.3586 7.8586A0.2 0.2 0 0 1 10.3586 8.1414L6 12.5" transform={turn ? `rotate(${turn} 8 8)` : undefined} /></svg>)const style = (properties: Record<string, string | number>) => properties as CSSProperties/** * A schedule the reader moves through by the day, the week, the month or as an agenda. React writes the * period from `scheduleLayout()`, the same layout the behavior writes, so it is in the first HTML; the behavior * answers the header and the day numbers and asks for the period to show. */export function Schedule({ events, value, defaultValue, onValueChange, onEventClick, today, locale, weekStart, lanes, from, to, messages, labels = {}, className, ...root }: ScheduleProps) {  const id = useId()  const settings = { today, locale, weekStart, lanes, from, to, messages }  const [first] = useState(() => scheduleLayout(value ?? defaultValue, settings).value)  const [shown, setShown] = useState(first)  const layout = useMemo(() => scheduleLayout(shown, { ...settings, events }), [shown, events, today, locale, weekStart, lanes, from, to, messages])  const ref = useBehavior(schedule, { ...settings, value: first, draw: setShown }, { value, defaultValue, onValueChange })  const more = messages?.more ?? ((count: number) => `+${count} more`)  const moreLabel = messages?.moreLabel ?? ((count: number, day: string) => `${count} more ${count === 1 ? 'event' : 'events'}, ${day}`)  const words = { today: 'Today', previous: 'Previous', next: 'Next', view: 'View', day: 'Day', week: 'Week', month: 'Month', agenda: 'Agenda', ...labels }  const event = (item: ScheduleItem, place?: Record<string, number>) => {    const content = <><span className="schedule-title">{item.title}</span>{item.time && !item.allDay ? <span className="schedule-time">{item.time}</span> : null}</>    const shared = { className: `schedule-event ${item.classes}`.trim(), style: place && style(Object.fromEntries(Object.entries(place).map(([name, number]) => [`--${name}`, number]))), 'aria-label': item.label }    return item.event.href      ? <a {...shared} href={item.event.href} key={`${item.id}${item.column}`}>{content}</a>      : <button type="button" {...shared} value={item.id} onClick={() => onEventClick?.(item.event)} key={`${item.id}${item.column}`}>{content}</button>  }  const list = (items: ScheduleItem[]) => <ol className="schedule-list">{items.map(item => <li key={item.id}>{event(item)}</li>)}</ol>  let body  if (layout.value.view === 'month') {    body = (      <div className="schedule-month">        <div className="schedule-weekdays" aria-hidden="true">{layout.weekdays.map(weekday => <span className="schedule-weekday" key={weekday.name}>{weekday.short}</span>)}</div>        <ol className="schedule-weeks">          {layout.weeks.map(week => (            <li className="schedule-week" style={style({ '--lanes': week.lanes })} key={week.days[0]!.date}>              {week.days.map((day, index) => [                <div className={day.outside ? 'schedule-date schedule-date-outside' : 'schedule-date'} style={style({ '--column': index + 1, '--count': day.count })} aria-current={day.today ? 'date' : undefined} key={day.date}>                  <button type="button" className="schedule-date-number" value={day.date} aria-label={day.summary}>{day.text}</button>                </div>,                ...day.items.map(item => event(item, { column: item.column, span: item.span, lane: item.lane })),                ...(day.hidden ? [                  <button type="button" className="schedule-more" style={style({ '--column': index + 1 })} popoverTarget={`${id}more${day.date}`} aria-label={moreLabel(day.hidden, day.label)} key={`${day.date}more`}>{more(day.hidden)}</button>,                  <div id={`${id}more${day.date}`} popover="" className="popover" key={`${day.date}list`}><p className="schedule-agenda-date">{day.label}</p>{list(day.all)}</div>,                ] : []),              ])}            </li>          ))}        </ol>      </div>    )  } else if (layout.value.view === 'agenda') {    body = layout.agenda.length      ? <ol className="schedule-agenda">{layout.agenda.map(day => <li className="schedule-agenda-day" aria-current={day.today ? 'date' : undefined} key={day.date}><h3 className="schedule-agenda-date">{day.heading}</h3>{list(day.items)}</li>)}</ol>      : <div className="empty"><p className="empty-title">{layout.words.empty}</p></div>  } else {    body = (      <div className="schedule" style={style({ '--schedule-from': layout.from, '--schedule-to': layout.to, '--schedule-days': layout.days.length })}>        <ol className="schedule-rail" aria-hidden="true">{layout.rail.map((label, index) => <li key={index}>{label}</li>)}</ol>        {layout.days.map((day, index) => (          <div className="schedule-day" style={style({ '--column': index + 1 })} aria-current={day.today ? 'date' : undefined} key={day.date}>            <h3 className="schedule-heading" aria-label={day.label}>{layout.days.length > 1 ? day.heading : day.label}</h3>            <ol className="schedule-events" aria-label={day.label}>{day.items.map(item => <li key={item.id}>{event(item, { start: item.start, end: item.end, lane: item.lane, lanes: item.lanes })}</li>)}</ol>          </div>        ))}        {layout.allDay.length ? (          <div className="schedule-allday" role="group" aria-label={layout.words.allDay}>            <span className="schedule-allday-label" aria-hidden="true">{layout.words.allDay}</span>            {layout.allDay.map(item => event(item, { column: item.column, span: item.span, lane: item.lane }))}          </div>        ) : null}      </div>    )  }  return (    <section className={className ? `schedule-view ${className}` : 'schedule-view'} aria-labelledby={`${id}title`} ref={ref} {...root}>      <div className="schedule-view-header">        <button type="button" className="btn btn-sm schedule-view-today">{words.today}</button>        <button type="button" className="btn btn-sm btn-square btn-quiet schedule-view-previous" aria-label={words.previous}>{chevron(180)}</button>        <button type="button" className="btn btn-sm btn-square btn-quiet schedule-view-next" aria-label={words.next}>{chevron()}</button>        <h2 className="schedule-view-title" id={`${id}title`} aria-live="polite">{layout.title}</h2>        <div className="segmented segmented-sm schedule-view-switch" role="radiogroup" aria-label={words.view}>          {(['day', 'week', 'month', 'agenda'] as const).map(name => (            <label className="segmented-item" key={name}><input type="radio" className="segmented-input" name={`${id}view`} value={name} defaultChecked={first.view === name} />{words[name]}</label>          ))}        </div>      </div>      <div className="schedule-view-body">{body}</div>    </section>  )}
ui/Schedule.svelte
<script lang="ts" module>  import type { HTMLAttributes } from 'svelte/elements'  import type { ScheduleEvent, ScheduleMessages, ScheduleValue } from '@master/ui/behaviors/schedule.js'  export type { ScheduleEvent, ScheduleValue }  /** The words of the header, in the page's language. */  export interface ScheduleLabels {    today?: string    previous?: string    next?: string    /** The name of the view switch. */    view?: string    day?: string    week?: string    month?: string    agenda?: string  }  export interface ScheduleProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {    events: ScheduleEvent[]    /** The day and the view on show. Bind it, or leave it out: today's month. */    value?: ScheduleValue    onValueChange?: (value: ScheduleValue) => void    /** An event without an `href` is a button: this hears it pressed. */    onEventClick?: (event: ScheduleEvent) => void    /** Today, as `YYYY-MM-DD`. Give it when the schedule is rendered on a server, so both sides agree. */    today?: string    /** A BCP 47 tag for the names. Give it when the schedule is rendered on a server. */    locale?: string    /** The first day of a week, 0 for Sunday to 6 for Saturday. The locale's own by default. */    weekStart?: number    /** How many events a day of a month shows before the rest go behind its more button. */    lanes?: number    /** The hours a day or a week shows at least. */    from?: number    to?: number    messages?: ScheduleMessages    labels?: ScheduleLabels  }</script><script lang="ts">  import { untrack } from 'svelte'  import { schedule, scheduleLayout, type ScheduleItem } from '@master/ui/behaviors/schedule.js'  import { behavior } from './behavior.svelte.js'  let { events, value = $bindable(), onValueChange, onEventClick, today, locale, weekStart, lanes, from, to, messages, labels = {}, class: className, ...root }: ScheduleProps = $props()  const id = $props.id()  const settings = () => ({ today, locale, weekStart, lanes, from, to, messages })  const first = untrack(() => scheduleLayout(value, settings()).value)  let shown = $state(first)  const layout = $derived(scheduleLayout(shown, { ...settings(), events }))  const attach = behavior(schedule, () => ({ ...settings(), value: first, draw: (next: ScheduleValue) => { shown = next } }), {    value: () => value,    change: (next) => { value = next; onValueChange?.(next) },  })  const more = $derived(messages?.more ?? ((count: number) => `+${count} more`))  const moreLabel = $derived(messages?.moreLabel ?? ((count: number, day: string) => `${count} more ${count === 1 ? 'event' : 'events'}, ${day}`))  const words = $derived({ today: 'Today', previous: 'Previous', next: 'Next', view: 'View', day: 'Day', week: 'Week', month: 'Month', agenda: 'Agenda', ...labels })  const views = ['day', 'week', 'month', 'agenda'] as const  const lane = (item: ScheduleItem) => `--column: ${item.column}; --span: ${item.span}; --lane: ${item.lane}`</script><!--  @component  A schedule the reader moves through by the day, the week, the month or as an agenda. Svelte writes the  period from `scheduleLayout()`, the same layout the behavior writes, so it is in the first HTML; the behavior  answers the header and the day numbers and asks for the period to show.-->{#snippet event(item: ScheduleItem, style?: string)}  {#if item.event.href}    <a class={['schedule-event', item.classes]} {style} href={item.event.href} aria-label={item.label}><span class="schedule-title">{item.title}</span>{#if item.time && !item.allDay}<span class="schedule-time">{item.time}</span>{/if}</a>  {:else}    <button type="button" class={['schedule-event', item.classes]} {style} value={item.id} aria-label={item.label} onclick={() => onEventClick?.(item.event)}><span class="schedule-title">{item.title}</span>{#if item.time && !item.allDay}<span class="schedule-time">{item.time}</span>{/if}</button>  {/if}{/snippet}{#snippet list(items: ScheduleItem[])}  <ol class="schedule-list">    {#each items as item (item.id)}<li>{@render event(item)}</li>{/each}  </ol>{/snippet}<section class={['schedule-view', className]} aria-labelledby="{id}title" {@attach attach} {...root}>  <div class="schedule-view-header">    <button type="button" class="btn btn-sm schedule-view-today">{words.today}</button>    <button type="button" class="btn btn-sm btn-square btn-quiet schedule-view-previous" aria-label={words.previous}>      <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 3.5L10.3586 7.8586A0.2 0.2 0 0 1 10.3586 8.1414L6 12.5" transform="rotate(180 8 8)" /></svg>    </button>    <button type="button" class="btn btn-sm btn-square btn-quiet schedule-view-next" aria-label={words.next}>      <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 3.5L10.3586 7.8586A0.2 0.2 0 0 1 10.3586 8.1414L6 12.5" /></svg>    </button>    <h2 class="schedule-view-title" id="{id}title" aria-live="polite">{layout.title}</h2>    <div class="segmented segmented-sm schedule-view-switch" role="radiogroup" aria-label={words.view}>      {#each views as name (name)}        <label class="segmented-item"><input type="radio" class="segmented-input" name="{id}view" value={name} checked={first.view === name} />{words[name]}</label>      {/each}    </div>  </div>  <div class="schedule-view-body">    {#if layout.value.view === 'month'}      <div class="schedule-month">        <div class="schedule-weekdays" aria-hidden="true">          {#each layout.weekdays as weekday (weekday.name)}<span class="schedule-weekday">{weekday.short}</span>{/each}        </div>        <ol class="schedule-weeks">          {#each layout.weeks as week (week.days[0]!.date)}            <li class="schedule-week" style="--lanes: {week.lanes}">              {#each week.days as day, index (day.date)}                <div class={['schedule-date', day.outside && 'schedule-date-outside']} style="--column: {index + 1}; --count: {day.count}" aria-current={day.today ? 'date' : undefined}>                  <button type="button" class="schedule-date-number" value={day.date} aria-label={day.summary}>{day.text}</button>                </div>                {#each day.items as item (item.id)}{@render event(item, lane(item))}{/each}                {#if day.hidden}                  <button type="button" class="schedule-more" style="--column: {index + 1}" popovertarget="{id}more{day.date}" aria-label={moreLabel(day.hidden, day.label)}>{more(day.hidden)}</button>                  <div id="{id}more{day.date}" popover="" class="popover"><p class="schedule-agenda-date">{day.label}</p>{@render list(day.all)}</div>                {/if}              {/each}            </li>          {/each}        </ol>      </div>    {:else if layout.value.view === 'agenda'}      {#if layout.agenda.length}        <ol class="schedule-agenda">          {#each layout.agenda as day (day.date)}            <li class="schedule-agenda-day" aria-current={day.today ? 'date' : undefined}><h3 class="schedule-agenda-date">{day.heading}</h3>{@render list(day.items)}</li>          {/each}        </ol>      {:else}        <div class="empty"><p class="empty-title">{layout.words.empty}</p></div>      {/if}    {:else}      <div class="schedule" style="--schedule-from: {layout.from}; --schedule-to: {layout.to}; --schedule-days: {layout.days.length}">        <ol class="schedule-rail" aria-hidden="true">          {#each layout.rail as label, index (index)}<li>{label}</li>{/each}        </ol>        {#each layout.days as day, index (day.date)}          <div class="schedule-day" style="--column: {index + 1}" aria-current={day.today ? 'date' : undefined}>            <h3 class="schedule-heading" aria-label={day.label}>{layout.days.length > 1 ? day.heading : day.label}</h3>            <ol class="schedule-events" aria-label={day.label}>              {#each day.items as item (item.id)}<li>{@render event(item, `--start: ${item.start}; --end: ${item.end}; --lane: ${item.lane}; --lanes: ${item.lanes}`)}</li>{/each}            </ol>          </div>        {/each}        {#if layout.allDay.length}          <div class="schedule-allday" role="group" aria-label={layout.words.allDay}>            <span class="schedule-allday-label" aria-hidden="true">{layout.words.allDay}</span>            {#each layout.allDay as item (item.id)}{@render event(item, lane(item))}{/each}          </div>        {/if}      </div>    {/if}  </div></section>
ui/Schedule.vue
<script lang="ts">import type { ScheduleEvent, ScheduleValue } from '@master/ui/behaviors/schedule.js'export type { ScheduleEvent, ScheduleValue }/** The words of the header, in the page's language. */export interface ScheduleLabels {  today?: string  previous?: string  next?: string  /** The name of the view switch. */  view?: string  day?: string  week?: string  month?: string  agenda?: string}</script><script setup lang="ts">import { computed, shallowRef, useId, useTemplateRef } from 'vue'import { schedule, scheduleLayout, type ScheduleItem, type ScheduleMessages } from '@master/ui/behaviors/schedule.js'import { useBehavior } from './use-behavior'defineOptions({ inheritAttrs: false })const { events, today, locale, weekStart, lanes, from, to, messages, labels = {} } = defineProps<{  events: ScheduleEvent[]  /** Today, as `YYYY-MM-DD`. Give it when the schedule is rendered on a server, so both sides agree. */  today?: string  /** A BCP 47 tag for the names. Give it when the schedule is rendered on a server. */  locale?: string  /** The first day of a week, 0 for Sunday to 6 for Saturday. The locale's own by default. */  weekStart?: number  /** How many events a day of a month shows before the rest go behind its more button. */  lanes?: number  /** The hours a day or a week shows at least. */  from?: number  to?: number  messages?: ScheduleMessages  labels?: ScheduleLabels}>()/** The day and the view on show: `v-model`. Today's month by default. */const model = defineModel<ScheduleValue>()/** An event without an `href` is a button: `eventClick` hears it pressed. */const emit = defineEmits<{ eventClick: [event: ScheduleEvent] }>()/* * A schedule the reader moves through by the day, the week, the month or as an agenda. Vue writes the period * from `scheduleLayout()`, the same layout the behavior writes, so it is in the first HTML; the behavior answers * the header and the day numbers and asks for the period to show. */const id = useId()const settings = () => ({ today, locale, weekStart, lanes, from, to, messages })const first = scheduleLayout(model.value, settings()).valueconst shown = shallowRef<ScheduleValue>(first)const layout = computed(() => scheduleLayout(shown.value, { ...settings(), events }))const root = useTemplateRef<HTMLElement>('root')useBehavior(root, schedule, () => ({ ...settings(), value: first, draw: (next: ScheduleValue) => { shown.value = next } }), model)const more = computed(() => messages?.more ?? ((count: number) => `+${count} more`))const moreLabel = computed(() => messages?.moreLabel ?? ((count: number, day: string) => `${count} more ${count === 1 ? 'event' : 'events'}, ${day}`))const words = computed(() => ({ today: 'Today', previous: 'Previous', next: 'Next', view: 'View', day: 'Day', week: 'Week', month: 'Month', agenda: 'Agenda', ...labels }))const views = ['day', 'week', 'month', 'agenda'] as constconst lane = (item: ScheduleItem) => `--column: ${item.column}; --span: ${item.span}; --lane: ${item.lane}`const hours = (item: ScheduleItem) => `--start: ${item.start}; --end: ${item.end}; --lane: ${item.lane}; --lanes: ${item.lanes}`</script><template>  <section class="schedule-view" :aria-labelledby="`${id}-title`" ref="root" v-bind="$attrs">    <div class="schedule-view-header">      <button type="button" class="btn btn-sm schedule-view-today">{{ words.today }}</button>      <button type="button" class="btn btn-sm btn-square btn-quiet schedule-view-previous" :aria-label="words.previous">        <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 3.5L10.3586 7.8586A0.2 0.2 0 0 1 10.3586 8.1414L6 12.5" transform="rotate(180 8 8)" /></svg>      </button>      <button type="button" class="btn btn-sm btn-square btn-quiet schedule-view-next" :aria-label="words.next">        <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 3.5L10.3586 7.8586A0.2 0.2 0 0 1 10.3586 8.1414L6 12.5" /></svg>      </button>      <h2 class="schedule-view-title" :id="`${id}-title`" aria-live="polite">{{ layout.title }}</h2>      <div class="segmented segmented-sm schedule-view-switch" role="radiogroup" :aria-label="words.view">        <label v-for="name in views" :key="name" class="segmented-item"><input type="radio" class="segmented-input" :name="`${id}-view`" :value="name" :checked="first.view === name" />{{ words[name] }}</label>      </div>    </div>    <div class="schedule-view-body">      <div v-if="layout.value.view === 'month'" class="schedule-month">        <div class="schedule-weekdays" aria-hidden="true">          <span v-for="weekday in layout.weekdays" :key="weekday.name" class="schedule-weekday">{{ weekday.short }}</span>        </div>        <ol class="schedule-weeks">          <li v-for="week in layout.weeks" :key="week.days[0]!.date" class="schedule-week" :style="`--lanes: ${week.lanes}`">            <template v-for="(day, index) in week.days" :key="day.date">              <div class="schedule-date" :class="{ 'schedule-date-outside': day.outside }" :style="`--column: ${index + 1}; --count: ${day.count}`" :aria-current="day.today ? 'date' : undefined">                <button type="button" class="schedule-date-number" :value="day.date" :aria-label="day.summary">{{ day.text }}</button>              </div>              <template v-for="item in day.items" :key="item.id">                <a v-if="item.event.href" :class="['schedule-event', item.classes]" :style="lane(item)" :href="item.event.href" :aria-label="item.label"><span class="schedule-title">{{ item.title }}</span><span v-if="item.time && !item.allDay" class="schedule-time">{{ item.time }}</span></a>                <button v-else type="button" :class="['schedule-event', item.classes]" :style="lane(item)" :value="item.id" :aria-label="item.label" @click="emit('eventClick', item.event)"><span class="schedule-title">{{ item.title }}</span><span v-if="item.time && !item.allDay" class="schedule-time">{{ item.time }}</span></button>              </template>              <template v-if="day.hidden">                <button type="button" class="schedule-more" :style="`--column: ${index + 1}`" :popovertarget="`${id}-more-${day.date}`" :aria-label="moreLabel(day.hidden, day.label)">{{ more(day.hidden) }}</button>                <div :id="`${id}-more-${day.date}`" popover="" class="popover">                  <p class="schedule-agenda-date">{{ day.label }}</p>                  <ol class="schedule-list">                    <li v-for="item in day.all" :key="item.id">                      <a v-if="item.event.href" :class="['schedule-event', item.classes]" :href="item.event.href" :aria-label="item.label"><span class="schedule-title">{{ item.title }}</span><span v-if="item.time && !item.allDay" class="schedule-time">{{ item.time }}</span></a>                      <button v-else type="button" :class="['schedule-event', item.classes]" :value="item.id" :aria-label="item.label" @click="emit('eventClick', item.event)"><span class="schedule-title">{{ item.title }}</span><span v-if="item.time && !item.allDay" class="schedule-time">{{ item.time }}</span></button>                    </li>                  </ol>                </div>              </template>            </template>          </li>        </ol>      </div>      <template v-else-if="layout.value.view === 'agenda'">        <ol v-if="layout.agenda.length" class="schedule-agenda">          <li v-for="day in layout.agenda" :key="day.date" class="schedule-agenda-day" :aria-current="day.today ? 'date' : undefined">            <h3 class="schedule-agenda-date">{{ day.heading }}</h3>            <ol class="schedule-list">              <li v-for="item in day.items" :key="item.id">                <a v-if="item.event.href" :class="['schedule-event', item.classes]" :href="item.event.href" :aria-label="item.label"><span class="schedule-title">{{ item.title }}</span><span v-if="item.time && !item.allDay" class="schedule-time">{{ item.time }}</span></a>                <button v-else type="button" :class="['schedule-event', item.classes]" :value="item.id" :aria-label="item.label" @click="emit('eventClick', item.event)"><span class="schedule-title">{{ item.title }}</span><span v-if="item.time && !item.allDay" class="schedule-time">{{ item.time }}</span></button>              </li>            </ol>          </li>        </ol>        <div v-else class="empty"><p class="empty-title">{{ layout.words.empty }}</p></div>      </template>      <div v-else class="schedule" :style="`--schedule-from: ${layout.from}; --schedule-to: ${layout.to}; --schedule-days: ${layout.days.length}`">        <ol class="schedule-rail" aria-hidden="true"><li v-for="(label, index) in layout.rail" :key="index">{{ label }}</li></ol>        <div v-for="(day, index) in layout.days" :key="day.date" class="schedule-day" :style="`--column: ${index + 1}`" :aria-current="day.today ? 'date' : undefined">          <h3 class="schedule-heading" :aria-label="day.label">{{ layout.days.length > 1 ? day.heading : day.label }}</h3>          <ol class="schedule-events" :aria-label="day.label">            <li v-for="item in day.items" :key="item.id">              <a v-if="item.event.href" :class="['schedule-event', item.classes]" :style="hours(item)" :href="item.event.href" :aria-label="item.label"><span class="schedule-title">{{ item.title }}</span><span v-if="item.time" class="schedule-time">{{ item.time }}</span></a>              <button v-else type="button" :class="['schedule-event', item.classes]" :style="hours(item)" :value="item.id" :aria-label="item.label" @click="emit('eventClick', item.event)"><span class="schedule-title">{{ item.title }}</span><span v-if="item.time" class="schedule-time">{{ item.time }}</span></button>            </li>          </ol>        </div>        <div v-if="layout.allDay.length" class="schedule-allday" role="group" :aria-label="layout.words.allDay">          <span class="schedule-allday-label" aria-hidden="true">{{ layout.words.allDay }}</span>          <template v-for="item in layout.allDay" :key="item.id">            <a v-if="item.event.href" :class="['schedule-event', item.classes]" :style="lane(item)" :href="item.event.href" :aria-label="item.label"><span class="schedule-title">{{ item.title }}</span><span v-if="item.time && !item.allDay" class="schedule-time">{{ item.time }}</span></a>            <button v-else type="button" :class="['schedule-event', item.classes]" :style="lane(item)" :value="item.id" :aria-label="item.label" @click="emit('eventClick', item.event)"><span class="schedule-title">{{ item.title }}</span><span v-if="item.time && !item.allDay" class="schedule-time">{{ item.time }}</span></button>          </template>        </div>      </div>    </div>  </section></template>

#Classes

ClassDescription
scheduleThe hours from --schedule-from to --schedule-to, each --schedule-hour tall: a rail of labels at the start, then one column for each day
schedule-nowDraws an ink line with a dot at --now through the day marked aria-current="date", or through every day when none is, and a hairline through the other daysApply with schedule
schedule-railThe labels of the hours, one item to an hour from --schedule-from to --schedule-to, each centered on its hairline. Hide it with aria-hidden: the events say their times in words
schedule-dayOne day's column, for several days side by side: an optional schedule-heading over its schedule-events. Mark today with aria-current="date". A schedule of one day may leave it out
schedule-headingThe name of a day, over its column, in muted ink; today's takes the strong ink
schedule-eventsThe events of one day, in order of time, on the scale's hairlines: one at every hour and one down the day's start
schedule-eventOne event from --start to --end, in lane --lane of --lanes: a quiet sheet of tinted ink with a rounded ink bar inside its start, a pixel clear of the hairlines. Put it on the list item, or on a link or a button inside one. A short event keeps one line
schedule-titleWhat the event is: one line that ends in an ellipsis. It stands in an event wherever the event is: on the hours, in a month, a list or an agenda
schedule-timeWhen it is, written with <time> elements: a quiet line under the title, or beside it in a short event when both fit. It stands in an event wherever the event is: on the hours, in a month, a list or an agenda
schedule-event-laneIn a lane instead of on the hours: --span days from day --column, on lane --lane, one line high. For an all-day band, a month and a list of eventsApply with schedule-event
schedule-event-continuedA piece of an event that began before: on the hours its top is square, in a lane its start, and it has no barApply with schedule-event
schedule-event-continuesA piece of an event that goes on after: on the hours its bottom is square, in a lane its endApply with schedule-event
schedule-event-plainA short event in a month or a list: no sheet, a dot for the bar, then its time and its titleApply with schedule-event
schedule-event-categoryThe sheet, bar and words of the category set by a category-<name> class on it or around itApply with schedule-event
schedule-alldayThe band under the headings for what lasts whole days, across the day columns: each day names its column with --column and the schedule says how many in --schedule-days. Holds a schedule-allday-label and lane events
schedule-allday-labelThe band's name in the rail's column, such as "All day"; aria-hidden, with the band named by its aria-label
schedule-monthA month: schedule-weekdays over schedule-weeks. In a narrow room each day shows a dot for each of its events instead of lanes
schedule-weekdaysThe names of the weekdays over the weeks; aria-hidden, since each day's number is named in full
schedule-weekdayOne weekday's name
schedule-weeksThe weeks, in order
schedule-weekA week: seven days, the numbers on the first row, --lanes rows of events and a row for the more buttons. Write each day, then the events that start on it, then its more button, so they read in the order of the days
schedule-dateA day: a cell from the top to the bottom of the week in column --column, with --count its number of events. Mark today with aria-current="date"
schedule-date-outsideA day of the month before or after: a quieter number on a faint trayApply with schedule-date
schedule-date-numberThe day's number, a round button that opens the day; its accessible name is the whole date and its count of events. Today's is ink
schedule-moreThe rest of a day's events past its lanes, on the week's last row in column --column: opens a popover that lists the day's events. Its accessible name says how many and which day
schedule-listEvents in the order they come, as lane events one above the other: a day's in its popover, each day's in the agenda
schedule-agendaThe period's days that have events, one to a row: the date at the start and a schedule-list beside it, or over it in a narrow room
schedule-agenda-dayOne day of the agenda; mark today with aria-current="date"
schedule-agenda-dateThe day's date, at the start of its row or over a day's list in a popover; today's takes the strong ink
schedule-viewA schedule the reader works: a schedule-view-header over a schedule-view-body, driven by the schedule behavior
schedule-view-headerThe controls: today, previous and next, the period's name and the view switch, with the name on a line of its own in a narrow room
schedule-view-titleThe period on show, such as "November 2026"; mark it aria-live="polite" so a move is heard
schedule-view-previousMoves back by the view's period
schedule-view-nextMoves on by the view's period
schedule-view-todayMoves to the period that holds today
schedule-view-switchHolds the radios that choose the view, with the values day, week, month and agenda; a segmented control
schedule-view-bodyWhere the behavior writes the period: a schedule for a day or a week, a schedule-month or a schedule-agenda

#Custom properties

PropertyDefaultDescription
--schedule-from8The first hour, from 0 to 24; fractions work
--schedule-to18The hour the schedule ends
--schedule-hour3remThe height of an hour
--schedule-rail3remThe width of the rail of labels
--schedule-colorvar(--color-surface-inverse)The ink the events are tinted and edged with
--nowThe hour of the line of schedule-now, such as 13.5 for half past oneSet on schedule
--startThe hour the event beginsSet on schedule-event
--endThe hour the event endsSet on schedule-event
--laneWhere the event stands among events that overlap it, from 0 at the start; 0 by defaultSet on schedule-event
--lanesHow many events stand side by side where this one does; 1 by defaultSet on schedule-event
--schedule-daysHow many day columns stand side by side, for a schedule with an all-day band; 1 by defaultSet on schedule
--columnIn a lane, the day the event starts on in its row, from 1; on a schedule-day, schedule-date or schedule-more, its columnSet on schedule-event
--spanIn a lane, how many days the event covers in its row; 1 by defaultSet on schedule-event
--lanesHow many lanes of events a week shows; 3 by defaultSet on schedule-week
--count0How many events the day holds, drawn as up to three dots in a narrow monthSet on schedule-date

#Source

@master/ui/components/schedule.css
/* * Schedule: a day as hours down a rail, each event as tall as it lasts. * The hours run from --schedule-from to --schedule-to, each --schedule-hour tall, with a hairline at every * hour. A rail of labels stands at the start, each label on the middle of its hairline; it is a picture of the * scale and is hidden from assistive technology. The events of a day are an ordered list: each sets --start * and --end in hours and says its title and its time in words, so the list reads without the drawing. * An event is a quiet sheet of tinted ink with a rounded ink bar standing inside its start, straight from end * to end where an edge drawn along the sheet would bend round its corners. It is inset from the hairlines so that two * events that meet keep a line between them. Events that overlap share the width: --lane is the event's place * and --lanes how many stand side by side. An event is a size container, so a short one keeps its title on * one line, puts the time beside it when there is room, and with no room for a line shows only its sheet. * The event marked aria-current is ink. schedule-now draws an ink line with a dot at --now, through the day * marked aria-current="date", and as a hairline through the other days; it passes under the events, so it * never strikes through their words. * Several days stand side by side as schedule-day columns, each with an optional heading over it. * Everything is placed by the stylesheet; nothing is measured by a script. * * Events that last whole days stand in lanes rather than on the hours: in schedule-allday, a band under the * headings, and in schedule-month, a month as weeks of seven days. Such an event (schedule-event-lane) spans * --span days from day --column on lane --lane; a piece that began in an earlier week or goes on past this one * is schedule-event-continued or schedule-event-continues, with square ends where it goes on. An event of a few * hours in a month is plain: a dot, its time and its title. A day of a month shows three lanes and a * schedule-more button for the rest; in a narrow month the lanes give way to a dot for each event under the day's * number, which opens the day. schedule-agenda lists the same events by day, for a narrow room or a reader who * would rather read than look. A category colors an event's sheet, bar and words (schedule-event-category). * * schedule-view is the schedule a reader works: a header with previous, today and next, the period's name and a * switch between day, week, month and agenda, over a body the schedule behavior writes from the events. */@layer components.ui {  .schedule {    --schedule-from: 8;    --schedule-to: 18;    --schedule-hour: 3rem;    --schedule-rail: 3rem;    --schedule-color: var(--color-surface-inverse);    /* The surface the schedule stands on, which a card or a sheet publishes; the event's tint is mixed with it. */    --schedule-surface: var(--surface-color, var(--color-surface-base));    --schedule-span: calc(var(--schedule-to) - var(--schedule-from));    display: grid;    grid-template-rows: auto calc(var(--schedule-span) * var(--schedule-hour));    grid-template-columns: var(--schedule-rail);    grid-auto-columns: minmax(0, 1fr);    grid-auto-flow: column;    min-width: 0;    margin: 0;    padding-block-end: .5rem;    color: var(--color-text-body);    font: 400 .8125rem/1.25rem var(--font-family-sans);    font-feature-settings: inherit;    font-variant-numeric: tabular-nums;    /* Without headings, the first label stands half above the first hour: keep it in the box. */    &:not(:has(.schedule-heading)) {      padding-block-start: .5rem;    }    /*     * With an all-day band, the headings, the band and the hours are three rows. The band runs across the days, so     * each day names its column with --column, from 1, and the schedule says how many there are in --schedule-days.     */    &:has(.schedule-allday) {      grid-template-rows: auto auto calc(var(--schedule-span) * var(--schedule-hour));      .schedule-rail {        grid-row: 3;      }      .schedule-day {        grid-column: calc(var(--column) + 1);        grid-row: 1 / span 3;      }      .schedule-events {        grid-row: 3;      }    }    /* Now: an ink line across the day, and a dot where it meets the day's edge. */    &.schedule-now .schedule-events {      &::before, &::after {        content: '';        position: absolute;        pointer-events: none;      }      /* The line passes under the events, so it never strikes through their words. */      &::after {        z-index: 0;        top: calc((var(--now, var(--schedule-from)) - var(--schedule-from)) * var(--schedule-hour));        inset-inline: 0;        height: 1px;        background: var(--color-text-strong);      }      &::before {        top: calc((var(--now, var(--schedule-from)) - var(--schedule-from)) * var(--schedule-hour) - 3px);        inset-inline-start: -3px;        width: 7px;        height: 7px;        z-index: 2;        border-radius: 999px;        corner-shape: round;        background: var(--color-text-strong);        box-shadow: 0 0 0 1.5px var(--schedule-surface);      }      @media (forced-colors: active) {        &::before, &::after {          forced-color-adjust: none;          background: CanvasText;        }      }    }    /* When one day is today, the line runs through the others as a hairline, with no dot. */    &.schedule-now:has(.schedule-day[aria-current="date"]) .schedule-day:not([aria-current="date"]) .schedule-events {      &::before {        content: none;      }      &::after {        background: var(--color-line-mark);        /* Kept out of forced colors with the line, so the hairline is the system's gray rather than a faint ink. */        @media (forced-colors: active) {          background: GrayText;        }      }    }    /* The ring that cuts the dot of now out of the line is the canvas, as a chart's and a heatmap's surface is. */    @media (forced-colors: active) {      --schedule-color: CanvasText;      --schedule-surface: Canvas;    }  }  /* The labels of the hours, one to an hour, each centered on its hairline. */  .schedule-rail {    display: grid;    grid-area: 2 / 1;    grid-auto-rows: var(--schedule-hour);    align-content: start;    margin: -.5rem 0 0;    padding: 0;    padding-inline-end: .5rem;    color: var(--color-text-muted);    /* The size of a chart's and a gantt's ticks. */    font-size: .71875rem;    line-height: 1rem;    list-style: none;    text-align: end;    white-space: nowrap;  }  /* One day: its heading over its events, on the schedule's own rows. */  .schedule-day {    display: grid;    grid-row: 1 / span 2;    grid-template-rows: subgrid;    min-width: 0;    margin: 0;  }  /* The name of a day, over its column. Today's takes the strong ink. */  .schedule-heading {    grid-row: 1;    min-width: 0;    margin: 0;    padding-block-end: .75rem;    overflow: hidden;    color: var(--color-text-muted);    font-size: .75rem;    font-weight: var(--font-weight-control);    line-height: 1rem;    text-align: center;    text-overflow: ellipsis;    white-space: nowrap;    .schedule-day[aria-current="date"] & {      color: var(--color-text-strong);    }  }  /*   * The events of a day, and the scale behind them: a hairline at every hour, one down the day's start, and   * the closing hairline under the last hour. The hours begin after the upright line, so no crossing is drawn twice.   */  .schedule-events {    --schedule-inset: 2px;    --schedule-inset-end: .5rem;    --schedule-lane-gap: 3px;    --schedule-line: var(--color-line-hair);    position: relative;    grid-row: 2;    min-width: 0;    margin: 0;    padding: 0;    /* Events, the line of now and a focused event stack inside the day, never over a sticky heading above it. */    isolation: isolate;    background:      linear-gradient(var(--schedule-line), var(--schedule-line)) left / 1px 100% no-repeat,      repeating-linear-gradient(180deg, var(--schedule-line) 0 1px, transparent 1px var(--schedule-hour)) right / calc(100% - 1px) 100% no-repeat;    box-shadow: 0 1px 0 var(--schedule-line);    list-style: none;    &:dir(rtl) {      background:        linear-gradient(var(--schedule-line), var(--schedule-line)) right / 1px 100% no-repeat,        repeating-linear-gradient(180deg, var(--schedule-line) 0 1px, transparent 1px var(--schedule-hour)) left / calc(100% - 1px) 100% no-repeat;    }    /* The hairlines stay, in the system's gray; the events inside keep the system's colors. */    @media (forced-colors: active) {      --schedule-line: GrayText;      forced-color-adjust: none;    }  }  /*   * One event, from --start to --end in hours, in lane --lane of --lanes. It stands a pixel clear of the   * hairline over it and the one under it. It goes on the list item, or on a link or a button inside one.   */  .schedule-event {    --schedule-length: calc((var(--end, 1) - var(--start, 0)) * var(--schedule-hour) - 3px);    --schedule-cell: calc((100% - var(--schedule-inset) - var(--schedule-inset-end) + var(--schedule-lane-gap)) / var(--lanes, 1));    --schedule-tint: color-mix(in oklab, var(--schedule-color) 7%, var(--schedule-surface));    --schedule-edge: color-mix(in oklab, var(--schedule-color) 62%, transparent);    --schedule-bar: 3px;    --schedule-bar-inset: 3px;    position: absolute;    z-index: 1;    top: calc((var(--start, 0) - var(--schedule-from)) * var(--schedule-hour) + 2px);    inset-inline-start: calc(var(--schedule-inset) + var(--lane, 0) * var(--schedule-cell));    container: schedule-event / size;    display: flex;    flex-flow: row wrap;    align-content: flex-start;    column-gap: .375rem;    box-sizing: border-box;    width: calc(var(--schedule-cell) - var(--schedule-lane-gap));    height: max(var(--schedule-length), 2px);    margin: 0;    /* A short event centers its one line; a longer one keeps the same inset at its top. */    padding: clamp(0px, (var(--schedule-length) - 1rem) / 2, .25rem) .375rem;    padding-inline-start: calc(var(--schedule-bar-inset) + var(--schedule-bar) + .3125rem);    border: 0;    border-radius: calc(var(--radius-chip) * var(--corner-scale));    corner-shape: var(--corner-shape);    overflow: hidden;    background: var(--schedule-tint);    color: var(--color-text-strong);    box-shadow: inset 0 0 0 .5px color-mix(in oklab, var(--schedule-color) 12%, transparent);    font: inherit;    font-feature-settings: inherit;    text-align: start;    text-decoration: none;    appearance: none;    -webkit-tap-highlight-color: transparent;    /* A button the behavior writes for an event the page opens answers the pointer as a link does. */    &:enabled {      cursor: pointer;    }    /*     * The bar: 3px wide, 3px in from the start and from the top and bottom, round at both ends, in a firm tint     * of the ink so it marks the event without shouting over its words. On an event too short to hold it     * inset, it comes out to the sheet's edges and stays a line rather than shrinking to a dot.     */    &::before {      content: '';      position: absolute;      inset-block: clamp(0px, (var(--schedule-length) - 12px) / 2, var(--schedule-bar-inset));      inset-inline-start: var(--schedule-bar-inset);      width: var(--schedule-bar);      border-radius: calc(var(--schedule-bar) / 2);      corner-shape: round;      background: var(--schedule-edge);      pointer-events: none;      @media (forced-colors: active) {        forced-color-adjust: none;        background: CanvasText;      }    }    /*     * In a lane: --span days from day --column, on lane --lane, one line high. In a month the first row is the     * day's number; in the all-day band the first column is the rail's.     */    &.schedule-event-lane {      --schedule-length: var(--schedule-lane-height, 1.375rem);      position: relative;      top: auto;      inset-inline-start: auto;      grid-column: calc(var(--column, 1) + var(--schedule-lane-column, 0)) / span var(--span, 1);      grid-row: calc(var(--lane, 0) + var(--schedule-lane-row, 1));      flex-wrap: nowrap;      align-items: center;      align-content: center;      width: auto;      min-width: 0;      height: var(--schedule-length);      margin-inline: 2px;      padding-block: 0;    }    /*     * A piece of an event that began before what is shown, or goes on after it: on the hours, past midnight, its     * top or its bottom is square and the bar runs to that edge; in a lane, past the week, its start or its end.     */    &.schedule-event-continued {      border-start-start-radius: 0;      border-start-end-radius: 0;      &::before {        inset-block-start: 0;        border-start-start-radius: 0;        border-start-end-radius: 0;      }    }    &.schedule-event-continues {      border-end-start-radius: 0;      border-end-end-radius: 0;      &::before {        inset-block-end: 0;        border-end-start-radius: 0;        border-end-end-radius: 0;      }    }    &.schedule-event-lane.schedule-event-continued {      margin-inline-start: 0;      padding-inline-start: .5rem;      border-start-start-radius: 0;      border-end-start-radius: 0;      border-start-end-radius: calc(var(--radius-chip) * var(--corner-scale));      border-end-end-radius: calc(var(--radius-chip) * var(--corner-scale));      /* It is not the start, so it has no bar. */      &::before {        content: none;      }    }    &.schedule-event-lane.schedule-event-continues {      margin-inline-end: 0;      border-start-end-radius: 0;      border-end-end-radius: 0;      &:not(.schedule-event-continued) {        border-start-start-radius: calc(var(--radius-chip) * var(--corner-scale));        border-end-start-radius: calc(var(--radius-chip) * var(--corner-scale));      }      &::before {        inset-block: clamp(0px, (var(--schedule-length) - 12px) / 2, var(--schedule-bar-inset));        border-radius: calc(var(--schedule-bar) / 2);      }    }    /* Plain: an event of a few hours in a month. No sheet, a dot for the bar, then its time and its title. */    &.schedule-event-plain {      --schedule-tint: transparent;      /* The words start as far past the dot as the dot stands in: at the bar's inset they touched it. */      padding-inline-start: calc(.3125rem + 6px + .3125rem);      box-shadow: none;      color: var(--color-text-body);      &::before {        inset-block: calc(50% - 3px);        inset-inline-start: .3125rem;        width: 6px;        height: 6px;        border-radius: 999px;        background: var(--schedule-edge);      }      .schedule-time {        flex: none;        order: -1;      }    }    /* A category: its surface for the sheet, its mark for the bar and its text for the words. */    &.schedule-event-category {      --schedule-tint: var(--category-surface, color-mix(in oklab, var(--schedule-color) 7%, var(--schedule-surface)));      --schedule-edge: var(--category-mark, color-mix(in oklab, var(--schedule-color) 62%, transparent));      color: var(--category-text, var(--color-text-strong));      box-shadow: inset 0 0 0 .5px var(--category-line, color-mix(in oklab, var(--schedule-color) 12%, transparent));      /* A plain event keeps the body's ink: its dot carries the category. */      &.schedule-event-plain {        --schedule-tint: transparent;        box-shadow: none;        color: var(--color-text-body);      }    }    /* Under the pointer the sheet is a step firmer, at once. */    @media (hover: hover) {      &:hover:not([aria-current="true"]) {        --schedule-tint: color-mix(in oklab, var(--schedule-color) 12%, var(--schedule-surface));      }      &.schedule-event-category:hover:not([aria-current="true"]) {        --schedule-tint: color-mix(in oklab, var(--category-mark, var(--schedule-color)) 14%, var(--category-surface, var(--schedule-surface)));      }      &.schedule-event-plain:hover:not([aria-current="true"]) {        --schedule-tint: color-mix(in oklab, var(--schedule-color) 6%, transparent);      }    }    /* The event that matters now, or the one that is open: ink. */    &[aria-current="true"] {      --schedule-edge: color-mix(in oklab, var(--color-text-inverse) 55%, transparent);      background: var(--schedule-color);      color: var(--color-text-inverse);      box-shadow: var(--shadow-ink-top);    }    &:focus-visible, &:has(:focus-visible) {      @apply --focus-ring;      z-index: 3;    }    @media (forced-colors: active) {      forced-color-adjust: auto;      outline: 1px solid CanvasText;      outline-offset: -1px;      &[aria-current="true"] {        forced-color-adjust: none;        background: Highlight;        color: HighlightText;        /* The bar stands on the highlight now, so it takes the highlight's text color, as the words do. */        &::before {          background: HighlightText;        }      }      /* The focus ring is the system's highlight, as every control's is in forced colors. */      &:focus-visible, &:has(:focus-visible) {        outline: 2px solid Highlight;        outline-offset: 2px;      }    }  }  /* What the event is: one line that ends in an ellipsis. */  .schedule-title {    flex: 1 0 100%;    min-width: 0;    margin: 0;    overflow: hidden;    font-size: .75rem;    font-weight: var(--font-weight-control);    line-height: 1rem;    text-overflow: ellipsis;    white-space: nowrap;  }  /* When it is: a quiet line under the title, in tabular figures. */  .schedule-time {    flex: 1 0 100%;    min-width: 0;    margin: 0;    overflow: hidden;    color: var(--color-text-muted);    font-size: .6875rem;    line-height: 1rem;    text-overflow: ellipsis;    white-space: nowrap;    .schedule-event[aria-current="true"] & {      color: color-mix(in oklab, var(--color-text-inverse) 72%, transparent);    }    /* On a category's surface the time keeps the category's text, which is the ink that reads there. */    .schedule-event-category:not([aria-current="true"]) & {      color: inherit;    }    @media (forced-colors: active) {      color: inherit;    }  }  /* A short event: the time beside the title when both fit, and under it, out of sight, when they do not. */  @container schedule-event (height < 2rem) {    .schedule-title, .schedule-time {      flex: 0 1 auto;    }    .schedule-time {      flex-shrink: 0;    }  }  /* Under a line's height: the sheet alone. Its words stay for assistive technology. */  @container schedule-event (height < .875rem) {    .schedule-title, .schedule-time {      opacity: 0;    }  }}@layer components.ui {  /*   * The all-day band: a row under the headings, across the days, with a lane for each event that runs a whole   * day or more. Its first column is the rail's, where its name stands. A hairline closes it above the hours.   */  .schedule-allday {    --schedule-lane-column: 1;    display: grid;    grid-row: 2;    grid-column: 1 / span calc(var(--schedule-days, 1) + 1);    grid-template-columns: subgrid;    grid-auto-rows: 1.375rem;    row-gap: 2px;    align-content: start;    min-height: 1.375rem;    margin: 0 0 .5rem;    padding: 0 0 .375rem;    box-shadow: 0 1px 0 var(--color-line-hair);    list-style: none;    /* The closing hairline is a shadow, which forced colors drop: a line of the system's gray takes a pixel of the padding. */    @media (forced-colors: active) {      padding-block-end: calc(.375rem - 1px);      border-block-end: 1px solid GrayText;    }  }  /* The name of the band, in the rail: "All day". */  .schedule-allday-label {    grid-column: 1;    grid-row: 1;    align-self: center;    padding-inline-end: .5rem;    color: var(--color-text-muted);    font-size: .71875rem;    line-height: 1rem;    text-align: end;    white-space: nowrap;  }  /*   * A month: the names of the weekdays over its weeks. It is a size container, so a narrow month shows each day's   * events as dots under its number and leaves the words to the day it opens.   */  .schedule-month {    --schedule-color: var(--color-surface-inverse);    --schedule-surface: var(--surface-color, var(--color-surface-base));    container: schedule-month / inline-size;    display: grid;    grid-template-columns: minmax(0, 1fr);    min-width: 0;    color: var(--color-text-body);    font: 400 .8125rem/1.25rem var(--font-family-sans);    font-feature-settings: inherit;    font-variant-numeric: tabular-nums;    @media (forced-colors: active) {      --schedule-color: CanvasText;    }  }  .schedule-weekdays {    display: grid;    grid-template-columns: repeat(7, minmax(0, 1fr));    padding-block-end: .5rem;    color: var(--color-text-muted);    font-size: .75rem;    font-weight: var(--font-weight-control);    line-height: 1rem;  }  .schedule-weekday {    min-width: 0;    padding-inline: .5rem;    overflow: hidden;    text-overflow: ellipsis;    white-space: nowrap;  }  .schedule-weeks {    display: grid;    margin: 0;    padding: 0;    box-shadow: 0 -1px 0 var(--color-line-hair);    list-style: none;  }  /*   * A week: seven columns, the day's number on the first row, --lanes rows of events under it, and a row for the   * days that have more than the lanes hold. Each day is a cell from the top to the bottom of the week.   */  .schedule-week {    --schedule-lane-row: 2;    display: grid;    grid-template-columns: repeat(7, minmax(0, 1fr));    grid-template-rows: 2.25rem repeat(var(--lanes, 3), 1.375rem) 1.375rem;    row-gap: 2px;    padding-block-end: .375rem;    box-shadow: 0 1px 0 var(--color-line-hair);  }  /* A day of a month: a cell the height of its week, with a hairline at its end. */  .schedule-date {    --count: 0;    display: flex;    flex-direction: column;    align-items: flex-start;    grid-column: var(--column, 1);    grid-row: 1 / -1;    min-width: 0;    margin-block-end: -.375rem;    padding: .375rem;    /* A hairline at the end of every day but the last of the week, which stands at the month's edge. */    box-shadow: inset calc(-1px * min(1, 7 - var(--column, 1))) 0 0 var(--color-line-hair);    &:dir(rtl) {      box-shadow: inset calc(1px * min(1, 7 - var(--column, 1))) 0 0 var(--color-line-hair);    }    /* A day of the month before or after: a quieter number on a faint tray. */    &.schedule-date-outside {      background: color-mix(in oklab, var(--color-surface-tray) 45%, transparent);      color: var(--color-text-muted);    }    /*     * The month's hairlines are shadows, which forced colors drop: every day is outlined in the system's gray     * instead, half a pixel in, so the outlines of neighbors fall on one line. A day outside the month is gray too.     */    @media (forced-colors: active) {      outline: 1px solid GrayText;      outline-offset: -.5px;      &.schedule-date-outside {        color: GrayText;      }    }  }  /* The day's number: a round button that opens the day. Today's is ink. */  .schedule-date-number {    display: inline-grid;    flex: none;    place-items: center;    min-width: 1.5rem;    height: 1.5rem;    margin: 0;    padding: 0 .3125rem;    border: 0;    border-radius: 999px;    corner-shape: round;    background: transparent;    color: inherit;    font: var(--font-weight-control) .75rem/1 var(--font-family-sans);    font-feature-settings: inherit;    font-variant-numeric: tabular-nums;    text-decoration: none;    appearance: none;    cursor: pointer;    -webkit-tap-highlight-color: transparent;    @media (hover: hover) {      &:hover {        background: var(--color-surface-chip);        color: var(--color-text-strong);      }    }    &:focus-visible {      @apply --focus-ring;    }    .schedule-date[aria-current="date"] & {      background: var(--color-surface-inverse);      color: var(--color-text-inverse);      box-shadow: var(--shadow-ink-top);    }    @media (forced-colors: active) {      .schedule-date[aria-current="date"] & {        forced-color-adjust: none;        background: Highlight;        color: HighlightText;      }      &:focus-visible {        outline-color: Highlight;      }    }  }  /* The rest of a day's events, past its lanes: a quiet button on the week's last row that lists them. */  .schedule-more {    grid-column: var(--column, 1);    grid-row: -2;    justify-self: start;    align-self: center;    margin: 0 2px;    padding: 0 .375rem;    height: 1.25rem;    border: 0;    border-radius: calc(var(--radius-chip) * var(--corner-scale));    corner-shape: var(--corner-shape);    background: transparent;    color: var(--color-text-muted);    font: var(--font-weight-control) .6875rem/1 var(--font-family-sans);    font-feature-settings: inherit;    /* The font shorthand resets the figures the month sets: the count keeps its tabular ones. */    font-variant-numeric: tabular-nums;    white-space: nowrap;    appearance: none;    cursor: pointer;    -webkit-tap-highlight-color: transparent;    /* 20px tall in its lane: on touch its target reaches 24px, as far as the lanes over and under it allow. */    @media (pointer: coarse) {      position: relative;      &::after {        content: '';        position: absolute;        inset: -2px 0;      }    }    @media (hover: hover) {      &:hover {        background: var(--color-surface-chip);        color: var(--color-text-strong);      }    }    &:focus-visible {      @apply --focus-ring;      @media (forced-colors: active) {        outline-color: Highlight;      }    }  }  /* A narrow month: a dot for each event, three at most, under the day's number; the number opens the day. */  @container schedule-month (width < 36rem) {    .schedule-week {      grid-template-rows: 3rem;      padding-block-end: 0;      .schedule-event, .schedule-more {        display: none;      }    }    .schedule-weekday {      padding-inline: 0;      text-align: center;    }    .schedule-date {      align-items: center;      margin-block-end: 0;      padding: .25rem 0;      &::after {        content: '';        width: calc(min(var(--count), 3) * 6px);        height: 4px;        margin-block-start: .1875rem;        background: radial-gradient(circle, var(--color-text-muted) 1.5px, transparent 2px) 0 0 / 6px 4px repeat-x;        /* The dots are a gradient, which forced colors would drop: kept out of them, in the system's text color. */        @media (forced-colors: active) {          forced-color-adjust: none;          background: radial-gradient(circle, CanvasText 1.5px, transparent 2px) 0 0 / 6px 4px repeat-x;        }      }    }    .schedule-date-number {      min-width: 2rem;      height: 2rem;      font-size: .8125rem;      /*       * Here the number is the only way into the day, with no events under it: on touch its target reaches 44px       * tall, short of the next week's, and the number keeps its size. It grows up and down only, since on a phone       * seven days leave a column narrower than 44px.       */      @media (pointer: coarse) {        position: relative;        &::after {          @apply --touch-target-block;        }      }    }  }  /* A list of events, in the order they come: a day's in its popover, and each day's in the agenda. */  .schedule-list {    display: flex;    flex-direction: column;    gap: 2px;    min-width: 0;    margin: 0;    padding: 0;    /* In a day's popover the list stands outside the month: its times keep the tabular figures the month sets. */    font-variant-numeric: tabular-nums;    list-style: none;    .schedule-event {      --schedule-lane-height: 1.625rem;    }  }  /*   * Agenda: the period's days that have events, one to a row: the date at the start, its events beside it. In a   * narrow room the date stands over its events.   */  .schedule-agenda {    --schedule-color: var(--color-surface-inverse);    --schedule-surface: var(--surface-color, var(--color-surface-base));    container: schedule-agenda / inline-size;    display: grid;    margin: 0;    padding: 0;    color: var(--color-text-body);    font: 400 .8125rem/1.25rem var(--font-family-sans);    font-feature-settings: inherit;    font-variant-numeric: tabular-nums;    list-style: none;  }  .schedule-agenda-day {    display: grid;    grid-template-columns: 7rem minmax(0, 1fr);    gap: .25rem 1rem;    padding-block: .75rem;    box-shadow: 0 1px 0 var(--color-line-hair);    &:last-child {      box-shadow: none;    }    /* The hairline between days is a shadow, which forced colors drop: a line of the system's gray takes a pixel of the padding. */    @media (forced-colors: active) {      padding-block-end: calc(.75rem - 1px);      border-block-end: 1px solid GrayText;      &:last-child {        padding-block-end: .75rem;        border-block-end: 0;      }    }  }  .schedule-agenda-date {    margin: 0;    padding-block-start: .1875rem;    color: var(--color-text-muted);    font-size: .75rem;    font-weight: var(--font-weight-control);    line-height: 1.25rem;    .schedule-agenda-day[aria-current="date"] & {      color: var(--color-text-strong);    }  }  @container schedule-agenda (width < 28rem) {    .schedule-agenda-day {      grid-template-columns: minmax(0, 1fr);    }  }  /*   * A schedule a reader works: a header of controls over the body the schedule behavior writes. The header keeps   * the period's name between the turns and the switch, and puts the name on a line of its own when the room is narrow.   */  .schedule-view {    container: schedule-view / inline-size;    display: grid;    grid-template-columns: minmax(0, 1fr);    gap: 1rem;    min-width: 0;  }  .schedule-view-header {    display: flex;    flex-wrap: wrap;    align-items: center;    gap: .5rem .75rem;    min-width: 0;  }  /* The period on show: "November 2026". Announced when it changes. */  .schedule-view-title {    flex: 1 1 auto;    min-width: 0;    margin: 0;    color: var(--color-text-strong);    font: var(--font-weight-control) 1rem/1.5rem var(--font-family-sans);    font-feature-settings: inherit;    font-variant-numeric: tabular-nums;    text-wrap: balance;    overflow-wrap: anywhere;  }  .schedule-view-switch, .schedule-view-today, .schedule-view-previous, .schedule-view-next {    flex: none;  }  /* Back and on point the way the days run: where they run from the right, the square turns round. */  .schedule-view-previous, .schedule-view-next {    &:dir(rtl) {      scale: -1 1;    }  }  @container schedule-view (width < 34rem) {    .schedule-view-title {      flex-basis: 100%;      order: -1;    }    .schedule-view-switch {      margin-inline-start: auto;    }  }  /* The body the behavior writes; it takes the room the header leaves and keeps the schedule's own scrolling. */  .schedule-view-body {    min-width: 0;    &:focus-visible {      @apply --focus-ring;      @media (forced-colors: active) {        outline-color: Highlight;      }    }  }}