Globetrotter docsversion 0.3.0 · 2026-12-04

Build a page

On this page
  1. 1. Make the page
  2. 2. Add a widget
  3. 3. The design panel, widget by widget
  4. 4. A list, and its data
  5. 5. The page's states
  6. 6. Errors
  7. 7. Done

A real page from start to finish, on the teaching app: Northgate Wholesale, a trade catalogue (examples/wholesale, no backend). You make one page, Offers, with a button that asks first and goes on, a list bound to data, the page's loading, empty and failed states, and you read what the checks say. Every step here was done in a copy of that app; the recordings are of those steps.

Before you start you need a project with the studio running (Your first project steps 1 to 3). To follow on the same app, npm run dev:wholesale in the clone edits examples/wholesale itself (copy the folder first to keep it as it is); or use your own project: the buttons are the same.

1. Make the page

New page, name it, keep the template that is selected, Create; the page is in the navigation and, a moment later, in the app.

  1. Press New page (above the layers).
  2. Type Offers. The route under it reads /offers.
  3. Keep Like this project: the shell the other pages share (app bar, navigation), the grid layout this design uses most, and its conventions. The other templates draw what they make: Blank, Article, Dashboard, List-detail, Detail, Settings, Form.
  4. Press Create. A notice says where the page went: "Added Offers (Like this project), in the navigation of Home, Products, … · ⌘Z undoes it".

The app has it at /g/offers. The page reads: a hero with Get started and See how it works, three lines of "Body copy goes here." and an empty section called Recent.

2. Add a widget

Open the Add tab (left). The first line says where a click goes: "Adding inside Page body · click to add, or drag onto the canvas", or inside whatever you selected on the canvas. Type in Filter widgets… (list), or switch Pictures to Names. Click a tile: the widget goes where the line said and is selected.

To put the list in the Recent section: click Recent on the canvas first, then the List tile.

3. The design panel, widget by widget

Click a widget on the canvas. The right side is one panel, with no tabs: everything about the selection, top to bottom.

The design panel with a button selected: What it does, Style with the button's variants and sizes, and the Ask Claude box under it
The design panel with a button selected: What it does, Style with the button's variants and sizes, and the Ask Claude box under it
Part What it is
the widget's name, with a small arrow press it to turn into another widget; what fits carries over
About what the widget is, where it comes from, and a link to every variant on the component sheet. Press again to hide it
arrows, +, bin move up, move down, duplicate, delete
What it does named for the widget: On press for a button or a row, What it edits for an input, Repeats over for a list, Opened by for a dialog
Style how it looks: its own variant and size, then Corners, Border, Fill, Padding, Gap, Custom CSS classes
States how the widget looks hovered, pressed, off or working
Content its words, icons and what it holds (buttons that add: Add menu, Add footer button)
More (folded) motion, behaviour, link, note, layer name

With nothing selected the panel is the page: its name and route, States, the lint count, and More (how it arrives, pull to refresh, the shell regions, the theme, the data contract).

Under the panel is Ask Claude, which names what it will change (below). Above the canvas are Map (below) and Code & handoff.

What it does: On press

Click Get started, choose Run an action, name it, say what happens after it, turn on Ask first, choose where it goes on; the line under it reads the whole press, and Code & handoff, Binding shows the handler it wrote.

Select Get started. Under On press the answer to "what pressing it does" is one choice of six:

Choice What you set
Nothing pressing it does nothing (yet)
Go to a page a page of this design, a path or an outside link
Open a menu Add item, Add group heading, Add divider; each item has its own On press. Edit menu selects the first item, Show open on the canvas draws it open, Remove menu takes it away
Open a dialog Which one (a dialog already on the page), or New dialog: Plain dialog, Confirm, Alert, Full-screen form, Bottom sheet: it is made, wired and opened on the canvas in one click. The row "Opens: … " has Show and Remove
Run an action see below
Toggle on and off a Field; each press flips it

Run an action has four fields:

  1. Action name: claimOffer. The binding gets a handler with this name.
  2. Then say: the words the page says when it worked, as a snackbar: Offer added to your quote.
  3. Ask first: on, and a Confirm dialog is made and wired ("Opens: Get started? (dialog)", with Show and Remove). The press then waits for the answer.
  4. Then go to: Quote list · /quote, or Stay here.

Under the fields, one line reads the press: "Get started → asks “Get started?” → runs claimOffer → says “Offer added to your quote” → goes to Quote list". Each part is a button that selects what it stands for.

Press Code & handoff, then Binding: sync wrote the handler as a stub, claimOffer: () => { /* TODO: … */ }. The words above the file say: "The untouched stub: it follows the design (new fields, new sample rows) until you edit it; from your first edit it is yours."

Style: roundness, border, fill, spacing, CSS

How do I change the roundness, border, fill, spacing or CSS of a button or a container? Select it and open Style. Every choice is a picture of a token, one click, and Default is a choice: nothing is a pixel value.

A button: Corners, then Border; then the section Recent: Border, Fill, Padding, Corners.

A section selected: Style with Corners, Border, Fill and Padding set, the canvas showing it
A section selected: Style with Corners, Border, Fill and Padding set, the canvas showing it
Row Choices
Variant, Size… the widget's own (a button's filled, tonal, outlined; its sizes), drawn as that widget
Corners None, XS, Small, Medium, Large, XL, Full (a button has Round and Square in place of Full)
Border and Border colour Default, None, Outline; the outline's colour role
Fill the theme's colour roles. The content takes the matching on-colour, so it stays readable
Padding, Gap None, XS, S, M, L, XL on the 4dp scale (containers); More… offers the steps between and beyond (3, 5, 10, 12, 16)
Custom CSS classes last: your own classes, for what the choices cannot say

It works on every widget with a surface, containers included (Section, Card, Stack, Grid item…). Hover a choice to try it on the canvas; Reset beside a row puts it back. The exact values and the tokens they use are in the reference.

States, About, the rest

States, About and More on the Get started button.

States draws the one widget in another state on the canvas, never saved, and puts it back to Rest when you select something else.

  • Automatic: Material's own, nothing to design: Hover, Focus, Pressed. A visitor's device draws them by itself.
  • Set by the page: Disabled, Error, Selected, Filled, Busy, whichever the widget has. The line under the choices says how the page sets it (for Busy: "the app shows progress and ignores a second press by itself"), and Go to On press jumps to the choice that causes it.

About (beside the widget's name) opens its description; press it again to close.

The other parts:

  • Content: its words and icons. The clip beside a field binds it to data.
  • More folds the remaining props (Options: variants, sizes, switches the widget has that are not looks) and three groups: Motion (Enters, As it scrolls into view, a shared name so two pages' versions of a thing morph into each other); Behaviour (Link to, Action, Opens, Toggle, Selected, Disabled, Loading, Field, Repeat over, Show when empty, Show while loading, Show when it fails, Show when the record is missing); and Advanced: Note (words for the handoff brief, not drawn); Ask (a change asked for here, pinned on the canvas as a numbered dot for an agent to do and clear); Layer name; Block (the saved block this came from).

Ask Claude

The box names its target as the selection changes: the page, a widget, several widgets. Words typed here are the ask.

The box under the panel reads "Ask Claude to change the page Offers", or the selected widget, or "3 selected widgets". Type what you want and press Enter: the box opens upward into the agent's log, where Run sends it. Nothing runs by itself. Setup, branches and what Claude can do are in Work with an agent.

The map: see the app as a flow

Map, click Products, click a press: the page opens with that widget selected.

The map: pages as boxes, Products clicked and its card of presses open
The map: pages as boxes, Products clicked and its card of presses open

Map (above the canvas) draws the design as boxes, one per page, with one arrow for each pair of pages that link. A ≡ marks a page in the navigation (those links are not drawn). Click a page for its card: where it goes, where it is reached from, and every press on it ("Add to quote · runs addToQuote"); a press opens its widget. The top says what is missing, as lists you can click: presses that do nothing yet and pages nothing leads to. Links & journeys holds the page graph you can play, and the journeys people tried. Back to the page returns to the canvas.

4. A list, and its data

Add a List in Recent, click its first row, type offers in Repeat over; Code & handoff, Binding shows the rows sync wrote.

  1. Click Recent, Add, filter list, click List.
  2. Click the first row (First item). Its first section is On press; below it, Repeats over.
  3. In Repeat over type offers and press Enter. A notice says: List item "First item" repeats over "offers", with the 2 rows like it folded in as its samples; what differed is bound to item.text, item.monogram. ⌘Z undoes it.
  4. Three buttons appear under it: Loading rows, Empty state, Error state, and the state bar above the canvas gains Empty.
  5. Code & handoff, Binding: src/bindings/wholesale--offers.ts now holds the three rows as samples, and the page's types, src/generated/wholesale--offers.types.ts, say what the page reads: offers: OffersOffersItem[] with monogram and text.

The rows in the binding are yours to change. Replace the samples with your data, with the same shape, in your editor:

import { notice } from '@globetrotter/widgets-m3/runtime';
import type { OffersBinding } from '../generated/wholesale--offers.types';

const offers = [
  { monogram: 'T', text: 'Tea towels: 10% off a carton' },
  { monogram: 'C', text: 'Candles: free delivery over 24' },
  { monogram: 'M', text: 'Mugs: buy 11, get the 12th' },
];

export function useOffersPage(): OffersBinding {
  return {
    data: { offers, quoteCount: 0 },
    actions: {
      claimOffer: async () => {},
    },
    status: 'ready',
  };
}

npx tsc --noEmit checks it against the types. Never write data or handlers in src/generated/*.tsx: the next sync would replace them.

The handler a binding lacks

Once the binding is yours, name an action on a row: the panel says the binding has no handler for it, and gives the line to copy. Add it; the app runs it.

Once you have edited the binding, sync no longer touches it, so a new action you name is not added for you. Select the first row, On press, Run an action, and name it openOffer. A red box appears under the fields in What it does:

The binding has no handler “openOffer” yet. Until it does, pressing it in the app only says so. Add it to actions in src/bindings/wholesale--offers.ts: openOffer: () => { /* what openOffer does */ },

Copy the line into actions (a row's handler receives the row: openOffer: (item) => { notice(Opened ${item.text}); }). In the app at /g/offers, press a row: the snackbar says "Opened Tea towels: 10% off a carton". Press Get started: the dialog "Get started?" asks, Get started confirms, and the app goes to the Quote list.

5. The page's states

Page is: Loading, Empty (Design this state), Failed (Design this state); then the app at ?state=empty and ?state=failed.

Above the canvas the bar Page is shows one moment of the page at a time, never saved:

Choice Draws
Loaded what people see once the data is in
Loading what people see while the data loads
Empty what people see when a list has nothing in it
Failed what people see when the data cannot load
Missing what people see when the record is not there (only on a page for one record, like /products/[id])

Only the moments this page can be in are offered: a page that reads no data says "This page reads no data, so it is only ever loaded", and a page with no list has no Empty.

Under the choices a line says what it shows. When nothing is designed for that moment it says what the app shows instead, and has a button:

Moment With nothing designed, the app shows
Loading only the app bar's progress line; a list with nothing yet is blank
Empty a blank list: nothing says there is nothing
Failed the snackbar with the error and Try again; a list stays blank
Missing the page without its record: blank where the record would be

Design this state adds a starting point (Empty: an Empty state with "No offers yet"; Failed: "Couldn't load offers" with a Try again button; Loading: loading rows). It is a widget like any other: select it and edit it. While a moment is picked, any widget you add belongs to it: the line says "Add a widget now and it belongs to this state", and the widget's Behaviour shows Show when empty (or while loading, when it fails) set for you. With the moment's widgets present, the line says "One widget on this page shows only then: select it."

Which data appears when the page lists more than one collection (Home has four): "All the page's data", or "Only Featured is loading" (or "is empty", "fails"). Use it when the page has one status but you want to see one list waiting while the others already have rows.

In the app. In development, ?state=loading|empty|failed|missing on a page's address shows that moment (/g/offers?state=empty); with NEXT_PUBLIC_GLOBETROTTER_STATES=1 it works in a build too. A page's own binding decides the real moment: while its status is 'loading' the app bar shows progress and the designed Loading widgets show; on 'error' the page shows error in a snackbar and the designed Failed widgets.

6. Errors

Add a button called Delete offer that runs an action: the list gains a note that it takes something away at one press; read why it matters, press Show, then Fix.

The chip at the top of the canvas counts the problems once: it reads Lint clean · 47 notes when there are only notes, and 1 warning or 1 error when there is one. It opens the list. In the recording the problem is a note, from the rule destructive-unconfirmed: "“Delete offer” takes something away at one press, with no way back. Ask first: a dialog it opens (“Delete offer?” with Cancel and Delete, where Delete runs deleteOffer) …", with the Fix "Ask first in a dialog".

  • This page and Whole design switch the list between the open page's findings and every page's, each with its count.
  • Each finding says what is wrong in one sentence that names what to do, then Why it matters (a sentence for the rules people meet most; the rest say what their severity means), then, when a mend exists, Fix: what it will change and a Fix button. ⌘Z undoes a Fix. Findings alike have one Fix all.
  • Show selects the widget with a callout on the canvas (Go to the … for a field, Show page for the page itself). A finding on another page opens that page first.
  • Errors stop a handoff and fail sync --check; warnings show in the page's handoff; notes are suggestions.

The same findings reach an agent as lint_design and apply_fix.

7. Done

npx globetrotter sync --check
npx globetrotter status

Next: Design a page for placing and arranging, Connect data for services and stores, Work with an agent for Claude Code.