Navigation

v2.1.0
Application blocks

Schedule view

A team calendar by the day, the week, the month or as an agenda.

A schedule view is a team's calendar on one sheet: a header to move through it, the period written from the events, and the details of an event a reader opens. The schedule and its behavior do the calendar; the block adds the sheet, the events of a real week and the drawer.

Schedule view

<section class="sheet p-lg" data-example="schedule-view" aria-label="Team calendar">  <div class="schedule-view" id="team">    <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" 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>  </div>  <dialog class="dialog dialog-drawer" id="team-event" closedby="any" aria-labelledby="team-event-title">    <header class="dialog-header">      <p class="m(0)">        <span class="badge badge-category badge-dot" id="team-event-calendar"></span>      </p>      <h2 class="dialog-title" id="team-event-title"></h2>      <p class="dialog-description" id="team-event-when"></p>    </header>    <div class="dialog-body">      <dl class="data-list">        <div class="data-list-item">          <dt class="data-list-term">Where</dt>          <dd class="data-list-value" id="team-event-where"></dd>        </div>        <div class="data-list-item">          <dt class="data-list-term">Who</dt>          <dd class="data-list-value" id="team-event-who"></dd>        </div>      </dl>    </div>    <footer class="dialog-footer">      <button type="button" class="btn" commandfor="team-event" command="close">Close</button>    </footer>  </dialog></section>
Open a day from its number, an event for its details, or switch to the week or the agenda.

Blocks are markup to copy. They take the page's own text color and size; the previews set fg-text-body text-sm on the body. Each block is a size container, so it reflows by its own width: in a wide page, a sidebar's worth of room or a dialog.

#What is in it

  • One sheet holds a schedule-view. Its header has today, previous and next, the period's name, announced when it changes, and a segmented switch between day, week, month and agenda.
  • The events are data. events.js is a week as an application hands it over: days for what lasts all day, local times for the rest, each end exclusive, and a category for the calendar it belongs to. The schedule behavior lays them out; it never edits or stores one.
  • A category is named. Each calendar's color comes with its name in the drawer's badge, and the event's title says what it is.
  • An event opens a drawer. An event without a link is a button whose value is its id; the page listens for it and fills a dialog drawer with its time, its place and who is in it. A day's list is a popover, which closes behind the drawer.
  • A narrow room keeps reading. The month shows a dot for each event under a day's number, the header puts the period's name on a line of its own, and the agenda lists the month by day.

#What needs a script

main.js attaches the behavior with the events and today's date and opens the drawer. Moving between periods and views, and laying out the month, the week and the agenda, is the behavior's. Creating, moving and saving events, time zones and repeating events stay with the application, which hands the schedule the events of the period it shows.

#Accessibility

  • The sheet is named "Team calendar", and the period's name is a live region that says where a move went.
  • A day's number is named with its date and how many events it holds; a more button says how many more and on which day.
  • An event is named with its title and when it is. The drawer is a modal dialog named by the event's title, and it gives focus back to the event when it closes.
  • A category's color is never alone: its name is in the drawer.