Skip to content

Signal

Components

Map shell

A full-bleed map with side or bottom sheets, a teaser and a tools dock.

A full-bleed map view with its controls, a sheet for the selection (or a teaser when nothing is selected) and an optional tools dock. Wide screens float the sheet at the leading side and the dock beside the controls; compact screens dock them to the bottom, like the iOS core sheet. The map library's own internals and attribution stay the page's.

Live example

The real classes from /site/chitransit.css in frames at phone, tablet and desktop widths, in the docs theme. The contract below shows each width in light and dark.

Phone · 390 × 760
Tablet · 768 × 900
Desktop · 1280 × 800

Code

<section class="ct-view ct-map-shell" aria-label="Map">
  <div class="ct-map-canvas" id="map"></div>
  <div class="ct-map-controls">…</div>
  <div class="ct-map-zoom">z 14</div>
  <aside class="ct-map-dock" aria-label="Map tools" hidden>…</aside>
  <div class="ct-map-teaser"><b class="ct-map-teaser-title">Map</b><span class="ct-map-teaser-text">Select a station, stop or vehicle.</span></div>
  <div class="ct-map-sheet" hidden>
    <div class="ct-map-sheet-grabber"></div>
    <div class="ct-map-sheet-scroll">…</div>
  </div>
</section>

Responsive behavior

ViewportLayout
> 900 wideSide sheet and teaser 420 wide (size.sideSheet) at the leading edge; dock 360 wide beside the controls.
≤ 900 wide or ≤ 500 tallSheet, teaser and dock are bottom sheets edge to edge; the sheet is at most 72% of the map tall and eases its height; the grabber becomes a 36pt drag handle.
≤ 500 tall and ≥ 600 wideThe sheet stays at the side, at most 48% of the map wide.

Tokens

From tokens/components.tokens.json. Override one instance by setting the property without the ct- prefix.

Custom propertyValueAliasResolves to
--ct-map-shell-backgroundvar(--map-ground){colors.mapGround}#F6F6F3 #141A21
--ct-map-shell-controls-top-compact28px
--ct-map-shell-dock-backgroundvar(--paper){colors.paper}#FFFFFF #0F141C
--ct-map-shell-dock-background-opacity96
--ct-map-shell-dock-blur10px
--ct-map-shell-dock-bordervar(--line){colors.line}#DADDE3 #263041
--ct-map-shell-dock-max-height-compactvar(--size-bottom-dock-maximum){size.bottomDockMaximum}620 pt
--ct-map-shell-dock-radiusvar(--r-modal){radius.dialog}20 pt
--ct-map-shell-dock-shadow-compactvar(--shadow-sheet){shadows.sheet}
--ct-map-shell-dock-shadowvar(--shadow-card){shadows.card}
--ct-map-shell-dock-widthvar(--size-side-dock){size.sideDock}360 pt
--ct-map-shell-grabber-colorvar(--switch-track){colors.switchTrack}#838995 #6A7488
--ct-map-shell-grabber-heightvar(--size-grabber-height){size.grabberHeight}5 pt
--ct-map-shell-grabber-radius3px
--ct-map-shell-grabber-widthvar(--size-grabber-width){size.grabberWidth}40 pt
--ct-map-shell-grabber-zone-compactvar(--size-minimum-tap-target){size.minimumTapTarget}44 pt
--ct-map-shell-grabber-zonevar(--size-sheet-grabber-zone){size.sheetGrabberZone}28 pt
--ct-map-shell-inset-compactvar(--space-map-inset-compact){spacing.mapInsetCompact}12 pt
--ct-map-shell-insetvar(--space-map-inset){spacing.mapInset}16 pt
--ct-map-shell-inset-shortvar(--space-8){space.s8}8 pt
--ct-map-shell-search-backgroundvar(--paper){colors.paper}#FFFFFF #0F141C
--ct-map-shell-search-colorvar(--muted){colors.muted}#5B6472 #B0BACA
--ct-map-shell-search-font-sizevar(--fs-body){type.body}16
--ct-map-shell-search-gapvar(--space-10){space.s10}10 pt
--ct-map-shell-search-glyph-colorvar(--ink){colors.ink}#101A2E #EEF1F6
--ct-map-shell-search-glyph-sizevar(--size-map-control-glyph){size.mapControlGlyph}20 pt
--ct-map-shell-search-heightvar(--size-map-search-bar){size.mapSearchBar}48 pt
--ct-map-shell-search-max-widthvar(--size-map-search-bar-maximum-width){size.mapSearchBarMaximumWidth}400 pt
--ct-map-shell-search-padding-xvar(--space-16){space.s16}16 pt
--ct-map-shell-search-radiusvar(--radius-pill){radius.pill}999 pt
--ct-map-shell-search-shadowvar(--shadow-fab){shadows.floating}
--ct-map-shell-sheet-backgroundvar(--paper){colors.paper}#FFFFFF #0F141C
--ct-map-shell-sheet-max-heightvar(--size-bottom-sheet-max-fraction){size.bottomSheetMaxFraction}.72 ratio
--ct-map-shell-sheet-padding-bottomvar(--space-32){space.s32}32 pt
--ct-map-shell-sheet-radiusvar(--r-sheet){radius.sheet}28 pt
--ct-map-shell-sheet-resize-durationvar(--motion-sheet-resize-duration){motion.sheetResizeDuration}.22 s
--ct-map-shell-sheet-shadowvar(--shadow-sheet){shadows.sheet}
--ct-map-shell-sheet-shadow-cardvar(--shadow-card){shadows.card}
--ct-map-shell-sheet-short-fractionvar(--size-side-sheet-short-fraction){size.sideSheetShortFraction}.48 ratio
--ct-map-shell-sheet-widthvar(--size-side-sheet){size.sideSheet}420 pt
--ct-map-shell-surface-card-backgroundvar(--card){colors.card}#EDEEF1 #1D232D
--ct-map-shell-surface-control-backgroundvar(--paper){colors.paper}#FFFFFF #0F141C
--ct-map-shell-surface-full-detent-opacity0
--ct-map-shell-surface-keylinevar(--line){colors.line}#DADDE3 #263041
--ct-map-shell-surface-keyline-width.5px
--ct-map-shell-surface-tab-bar-backgroundvar(--paper){colors.paper}#FFFFFF #0F141C
--ct-map-shell-teaser-padding-bottomvar(--space-20){space.s20}20 pt
--ct-map-shell-teaser-padding-topvar(--space-8){space.s8}8 pt
--ct-map-shell-teaser-text-colorvar(--muted){colors.muted}#5B6472 #B0BACA
--ct-map-shell-teaser-text-gapvar(--space-4){space.s4}4 pt
--ct-map-shell-teaser-text-sizevar(--fs-sub){type.sub}13
--ct-map-shell-teaser-title-gapvar(--space-14){space.s14}14 pt
--ct-map-shell-teaser-title-sizevar(--fs-title){type.title}20
--ct-map-shell-teaser-title-weightvar(--weight-bold){weight.bold}700
--ct-map-shell-z-index-controlsvar(--z-map-controls){zIndex.mapControls}500 index
--ct-map-shell-z-index-dockvar(--z-map-dock){zIndex.mapDock}700 index
--ct-map-shell-z-index-sheetvar(--z-map-sheet){zIndex.mapSheet}600 index
--ct-map-shell-zoom-bottom-compactvar(--space-16){space.s16}16 pt
--ct-map-shell-zoom-bottom28px

Variants

One shell; no variants. Inside .ct-map-shell: .ct-map-canvas, .ct-map-controls, .ct-map-zoom, a .ct-map-sheet or .ct-map-teaser, and an optional .ct-map-dock. The bottom-sheet layout follows the viewport, and sheet.js adds .is-detented and .is-dragging. Surface fills: .ct-map-surface--card, --control and --tab-bar. Nothing else exists.

  • Something is selected: .ct-map-sheet.
  • Nothing is selected: .ct-map-teaser.
  • Tools for the map itself: .ct-map-dock, beside the controls.
<!-- Do -->
<section class="ct-view ct-map-shell" aria-label="Map">
  <div class="ct-map-canvas" id="map"></div>
  <div class="ct-map-controls">…</div>
  <div class="ct-map-teaser"><b class="ct-map-teaser-title">Map</b><span class="ct-map-teaser-text">Select a station, stop or vehicle.</span></div>
  <div class="ct-map-sheet" hidden>…</div>
</section>
<!-- Don't: a hand-made sheet in place of .ct-map-sheet -->
<div class="my-sheet" style="position:absolute;bottom:0">…</div>

Usage

Do

  • Drive the bottom sheet with sheet.js (ChiTransitSheet.attach(sheet, { detents, active, teaser, onClose })): it drags from anywhere on the sheet, throws to the detent the flick projects to, rubber-bands past the top, springs open and closed along the same path, and cross-fades under Reduce Motion. Its grabber is a slider: arrow keys and Home/End move between detents. Closing returns focus to what opened the sheet (returnFocus: false skips that).
  • Keep a list route to everything the map shows.

Don't

  • Don't restyle the map library's controls or attribution in Signal; theme them in the page.

Accessibility

  • Name the sheet by its title; give the drag handle a button alternative inside the sheet.

Contract

Contract: components/map-shell.yaml. States are drawn live by transit.js.