Canvas Design System
Main Site Tokens

Session Shape

A short session at a glance: an energy line over a time bar, on one horizontal scale. Each block is as wide as its minutes; the line over it is how lively that part runs.

When to Use

Use when: A session should be read at a glance before its steps: a recipe page shows one above its exercise tiles. Give each part an href to its step further down.
Don't use when: The reader needs start times (an Agenda), a workshop is being graded with a score and metrics (an Energy Arc Card), or there is one proportion to show (a Progress bar).

Variants

A 90-minute recipe

Opening and closing are grey, exercises the soft brand fill. Below 600px the names give way to the minutes, and each block keeps its spoken name.

<?= ws_session_shape([
    ['name' => 'Check-in', 'minutes' => 10, 'kind' => 'frame', 'energy' => 2, 'href' => '#recipe-step-1'],
    ['name' => 'Reverse Brainstorming', 'minutes' => 25, 'energy' => 4, 'href' => '#recipe-step-2'],
    ['name' => 'TRIZ', 'minutes' => 20, 'energy' => 4, 'href' => '#recipe-step-3'],
    ['name' => '15% Solutions', 'minutes' => 20, 'energy' => 3, 'href' => '#recipe-step-4'],
    ['name' => 'Commit: who does what by when', 'minutes' => 15, 'kind' => 'frame', 'energy' => 1, 'href' => '#recipe-step-5'],
]) ?>

With a control under the time bar

A control that reshapes the session sits as its own row, on the time bar's scale, with an axis word beside it. The control names itself; the axis word is hidden from assistive technology. A recipe page passes its length slider and redraws the shape when it moves.

  • Opening and closing
  • Exercise
<?= ws_session_shape($parts, [
    'control' => ws_range('length', ['label' => 'Length', 'hideLabel' => true, 'min' => 60, 'max' => 90, 'step' => 30, 'value' => 90, 'valueText' => '90 minutes']),
    'controlLabel' => 'Length',
]) ?>

Options

OptionTypeDefaultPurpose
$partsarrayrequiredEach part: name, minutes, kind (frame or exercise), energy (1 to 5, default 3), href
labelstring'Shape of the session'The group's accessible name
controlstring''Rendered HTML for a row under the time bar, on its scale: a ws_range that reshapes the session
controlLabelstring''The control row's axis word, beside it like "Time"
idstring''Element ID
classstring''Additional CSS classes
attrsarray[]Extra HTML attributes

Accessibility

ConcernBehavior
GroupA group named by label.
Energy lineAn image named in words: "Energy starts low at Check-in, peaks during Reverse Brainstorming and ends low at Commit".
Time barAn ordered list, each block named "Check-in, 10 minutes", so the shortened names and the "10m" are never all a screen reader hears. A part with href is a link with a focus ring.
ColourOpening and closing differ from exercises in fill and in the legend's words, never by colour alone.

Tokens

TokenUsed for
--brandThe energy line
--brand-soft, --brand-inkExercise blocks
--gray-100, --text-defaultOpening and closing blocks
--text-micro, --text-caption, --text-mutedThe axis labels, block text and legend
--focus-ringA linked block's focus ring

CSS Classes

ClassPurpose
.ws-session-shapeThe group
.ws-session-shape__energyThe line, an SVG
.ws-session-shape__timeThe time bar, an ordered list
.ws-session-shape__block--frame / --exerciseA block's kind
.ws-session-shape__block--m5 to --m120A block's width, its minutes rounded to 5
.ws-session-shape__legendThe key

Files

FilePurpose
includes/components/helpers.phpws_session_shape()
includes/components/session-shape.phpTemplate: the line, the bar and the legend
includes/components/components.cssStyles (.ws-session-shape rules)