Component Kit Reference
Reference template

One component source, shown everywhere.

Every component below is rendered from its dedicated HTML file. Edit place-card.html and the Place Card preview here changes too; edit a token in global.css and both standalone components and this documentation shell update together.

Single source of truth

The index does not copy component markup. Each preview is the corresponding standalone HTML file in embed mode, while shared visual rules remain in global.css.

Template

Documentation page anatomy

The reference template keeps stable deep links on desktop and mobile. Nested navigation can be collapsed without removing the section link itself.

Desktop: sticky left navigation stays visible while the main document scrolls.

Mobile: the same navigation becomes an off-canvas drawer.

Nested sections: the section label jumps to content while the adjacent chevron only expands or collapses its children.

Live references: component examples come from the same HTML files you edit directly.

Foundations

Design tokens

Tokens are shared by the documentation shell and every standalone component. The section can collapse without changing its #tokens deep link.

Spacing scale

The original 12px+ scale remains intact. The audit adds only 2px, 4px, and 8px utility steps for compact controls and panel chrome.

--space-01252px
--space-0254px
--space-058px
--space-112px
--space-224px
--space-330px
--space-439px
--space-563px
--space-696px

Color

Semantic tokens are theme-aware. Toggle the theme in the top bar and the embedded components receive the same theme state. --accent stays blue for links, selection, and focus. Primary buttons use --btn-primary.

--bgBackground
--surfaceSurface
--textText
--accentAccent
--btn-primaryPrimary button
--on-btn-primaryOn primary

Type

Type tokens are fixed sizes. Component labels, titles, controls, and this page use the same steps.

TokenUseSample
--text-xsMetadata and compact labelsReference label
--text-smControls and supporting copySupporting copy
--text-baseBody and form contentBody content
--text-lgComponent headingsComponent heading
--text-xlPage and panel titlesPage title
--text-2xlDocumentation titleDocumentation title

Radius

The token values remain aligned with the original system. The audit makes --radius-sm (6px) the default component radius; 12px is reserved for deliberately larger surfaces.

TokenValueUse
--radius-sm6pxPanels, inputs, buttons, tiles, menus, previews
--radius12pxLarge surfaces such as modal dialogs
--radius-full9999pxPills, chips, switches, circular controls

Control sizing

Editor panels size hex, opacity, and weight with .combo at --control-height-sm. The .input--* utilities are for a lone field, not a substitute for that combo.

Token / utilityValueUse
--control-height-xs / --icon-btn-size28px.icon-btn and default .btn--icon. .input--xs is the lone-field height.
--control-height-sm / .input--sm32px.combo segments. .btn--icon.btn--md uses this height.
--control-height-md36pxDefault text and select. .btn--icon.btn--lg uses this height.
--control-width-hex / .input--hex88px.combo__hex. Do not use .input--hex alone inside a panel.
--control-width-compact / .input--compact56px.combo__opacity and .combo__width.
Foundations

Shared primitives

Link global.css once. These classes are the kit. A page <style> block is only for specimen layout that is not a component, such as the Place Card state key. .kit-frame is the shared 340px specimen column. Canonical tabs, search, and icon-button choices are in docs/PATTERNS.md. Status, focus, and selection tokens are in docs/STATUS-FOCUS.md.

PrimitivePurposeSource
.btn / .btn--iconText actions. .btn--primary uses the ink button tokens, not --accent. .btn--icon is the bordered icon-only button and shares its box with .icon-btn.global.css
.icon-btnCanonical icon-only control for panel headers, toolbars, and tips. Size is --icon-btn-size.global.css
.panelCards, dialogs, menus, and editor surfaces. Put .panel--flush on the panel, not on a wrapper.global.css
.field / .input / .select / .textareaShared form geometry.global.css
.input-groupSearch and other fields with a leading icon and an optional clear button.global.css
.switch / .checkbox-row / .radio-rowToggle and choice rows.global.css
.comboHex, opacity, and optional weight. Fill omits .combo__width; border includes it. Swatch and hex are the same color.global.css
.swatchColor chip, including the saved palette grid (.swatch-grid).global.css
.tile / .tile-gridSelectable icon and pattern tiles.global.css
.list-rowLayer or place row. Drag the handle to reorder in the Map Layers specimen.global.css
.visibility-toggleShow or hide a layer.global.css
.prop-row / .field-labelLabelled property stack.global.css
.badge / .chipStatus and filter chips.global.css
.tabsUnderline tabs, plus .tabs--pill. Each tab has aria-controls.global.css
.menu / .menu-listDropdown menu on a .panel--pop.panel--flush body.global.css
dialog.modalNative dialog. Closed dialogs stay out of the accessibility tree. The body is a .panel.panel--pop.global.css
.alert / .toastInline banners and floating toasts.global.css
.tooltipHover and focus helper text.global.css
.color-pickerPicker anatomy. The Color Library specimen does not wire the field to the swatch.global.css
.icon-picker-trigger / .icon-edit-panelPlace Card icon editor. .icon-picker-trigger--empty is the dashed empty state.global.css
.layer-head / .plain-field / .upload-btnMap Layers title, description, and upload.global.css
.cs-*Color Scale panel chrome. Ramp math stays in color-scale.html.global.css
.side-nav / .component-previewDocumentation navigation and the live preview frame.global.css
Components

Map editor

Every component is shown here from its standalone HTML file. Shared chrome is in global.css. The nested navigation links directly to each preview, and the filename beside each preview opens that same source as a standalone page.

Edit the source file, not this index. For example, change place-card.html and reload this page; the Place Card preview below is that exact file.

Editor panel

Color Scale

Token-backed OKLab ramps with a fixed seed. Sequential scales stay monotonic in lightness; pairs that collapse lightness are marked unsafe for choropleths.

color-scale.html
Editor panel

Color + Icon Library

Static picker anatomy, a swatch grid, an .input-group search, icon tiles, and combos whose swatch matches the hex.

color-library.html
Editor panel

Place Card

Icon trigger, name, description, and shared panel anatomy.

place-card.html
Editor panel

Map Layers

Drag a row handle to reorder. Fill and border combos, pattern tiles, and visibility. Places and Design use the shared tabs.

map-layers.html
Action

Button

Primary, secondary, ghost, danger, link, icon, disabled, and size variants.

button.html
Form

Form Inputs

Text, select, textarea, checkbox, radio, switch, help, and error states.

inputs.html
Overlay

Modal / Dialog

Confirm and form dialog examples built on the shared panel shell.

modal.html
Navigation

Tabs

Underline and pill tab treatments with interactive states.

tabs.html
Feedback

Toast / Alert

Inline banners and transient floating feedback.

toast.html
Status

Badge / Chip

Statuses, counts, filter chips, swatches, and removable values.

badge.html
Disclosure

Tooltip

Hover and focus helper text for compact actions.

tooltip.html
Menu

Dropdown / Menu

Sort and overflow action menus using the shared popover panel.

dropdown.html
Authoring

Single-source component pattern

Keep each component editable as a normal HTML file. The index references it instead of duplicating its markup.

<!-- place-card.html: edit this file directly -->
<link rel="stylesheet" href="global.css">
...
<script src="component-embed.js"></script>

<!-- index.html: render that same source file -->
<iframe
  class="component-preview"
  src="place-card.html?embed=1"
  title="Place Card live component reference">
</iframe>

component-embed.js only changes presentation when the file is embedded: it hides demo-page chrome, reports its content height to the index, and receives the documentation theme. It does not contain component markup.

Authoring

Responsive behavior

The information architecture remains the same across breakpoints, including every component anchor.

  • Desktop keeps the navigation sticky and independently scrollable.
  • Below 860px, navigation becomes an off-canvas drawer with overlay and Escape-key support.
  • Nested navigation trees can collapse independently from the content sections they link to.
  • Design Tokens and Map editor can also collapse in the document; following a deep link reopens the relevant section automatically.
  • Component iframes resize to their own content to avoid nested scrolling.