Your first project
This page starts a Starboard project from nothing: a trip-planning app with two screens on iOS and the web, and one flow that goes between them. Every command and file on this page is run by Starboard’s own tests, in this order, so what you see is what you get.
Run the commands at the root of your app’s repository. Starboard keeps
everything in plain files there: starboard.yaml and a docs/flows/
directory.
Create the project
Section titled “Create the project”starboard init --platform ios --platform webinit lists every file it writes:
.gitattributesdocs/flows/README.mddocs/flows/flows/example.mddocs/flows/generated/app-map.mddocs/flows/generated/screens.mddocs/flows/generated/wireframes/home.main.phone.svgdocs/flows/generated/wireframes/home.main.web-narrow.svgdocs/flows/generated/wireframes/home.main.web-wide.svgdocs/flows/screens.yamlstarboard.yamlstarboard.yamlis the project’s configuration. Its directory is the project root: every command finds the project by looking for it, from the working directory upward.docs/flows/screens.yamlis the registry: one entry per screen.initwrites one example screen,home.main.docs/flows/flows/example.mdis an example flow.docs/flows/generated/is written bystarboard generate. Never edit it by hand.docs/flows/README.mdtells people who find the directory what it is..gitattributesgets three lines that keep these files’ line endings the same on every operating system. Keep them.
init wrote this starboard.yaml:
version: 1platforms: ios: formFactors: [phone] screenFiles: ['**/*View.swift'] web: formFactors: [web-narrow, web-wide] screenFiles: ['**/*.{tsx,svelte,vue}']areas: [home]Each platform draws its wireframes at its form factors: iOS at phone,
the web at a narrow and a wide browser window. areas are the parts of the
product, in the order the generated pages list them. See
Projects, platforms and form factors
for what each setting means.
Register your screens
Section titled “Register your screens”Add a trip area for the second screen. Edit starboard.yaml:
version: 1platforms: ios: formFactors: [phone] screenFiles: ['**/*View.swift'] web: formFactors: [web-narrow, web-wide] screenFiles: ['**/*.{tsx,svelte,vue}']areas: [home, trip]Then replace the example screen in docs/flows/screens.yaml with two of
your own: the list of trips, and one trip’s timeline.
screens: home.trips: title: Your trips area: home purpose: Every trip you plan or travel on, the next one first. presentation: root layout: - {region: title, kind: header, label: Trips} - region: trips kind: list item: {kind: card, label: Trip · dates · people, to: trip.timeline} empty: label: No trips yet - {region: new-trip, kind: primary-action, label: New trip} trip.timeline: title: Timeline area: trip purpose: The trip's days in order, with what happens on each. presentation: push layout: - region: app-bar kind: bar children: - {region: back, kind: action, label: Trips, to: home.trips} - {region: title, kind: header, label: Trip name · dates} - region: days kind: list item: {kind: card, label: Time · activity · who is going} empty: label: No activities yet - {region: add-activity, kind: primary-action, label: Add activity}Each screen has a stable dotted ID (home.trips), a title, an area, a
purpose and a presentation: how a person gets there (root, push,
tab, sheet, dialog, window or route). Its layout is a tree of
named regions, each of a fixed kind such as list or
primary-action. A to: is a link to another screen. See
Screens and regions.
The example flow still refers to home.main, which is gone, so delete
docs/flows/flows/example.md.
Now format the files, regenerate generated/ and check the project:
starboard fmtstarboard generatestarboard lintwrote docs/flows/generated/app-map.mdwrote docs/flows/generated/screens.mdremoved docs/flows/generated/wireframes/home.main.phone.svgremoved docs/flows/generated/wireframes/home.main.web-narrow.svgremoved docs/flows/generated/wireframes/home.main.web-wide.svgwrote docs/flows/generated/wireframes/home.trips.phone.svgwrote docs/flows/generated/wireframes/home.trips.web-narrow.svgwrote docs/flows/generated/wireframes/home.trips.web-wide.svgwrote docs/flows/generated/wireframes/trip.timeline.phone.svgwrote docs/flows/generated/wireframes/trip.timeline.web-narrow.svgwrote docs/flows/generated/wireframes/trip.timeline.web-wide.svgdocs/flows/screens.yaml:2: warn orphan-screen: no flow references home.trips (screens.home.trips)docs/flows/screens.yaml:15: warn orphan-screen: no flow references trip.timeline (screens.trip.timeline)0 errors, 2 warningsfmtrewrites files that are not in canonical form and lists them. These files already were, so it printed nothing.generatewrote the app map, the screen catalog and one wireframe per screen per form factor, and removed the example screen’s wireframes.lintfound no errors, and two warnings: no flow mentions either screen. Warnings do not faillintunless you pass--strict. Each finding names its rule; orphan-screen explains this one.
Write your first flow
Section titled “Write your first flow”A flow is one thing a person does, as a Markdown file in docs/flows/flows/.
It refers to screens as @screen.id and to regions as @screen.id#region.
Create docs/flows/flows/open-a-trip.md:
---id: open-a-triptitle: Open a tripstatus: shippedactors: [traveller]entry: home.trips---
**Goal:** see what is planned on a trip.
```mermaidflowchart TD trips["@home.trips"] -->|"@home.trips#trips"| timeline["@trip.timeline"] timeline -->|"@trip.timeline#back"| trips```
## Steps
1. Tap the trip in @home.trips#trips. - With no trips yet, the list says so; start one with @home.trips#new-trip.2. Read the plan, day by day, in @trip.timeline#days.The file name, less .md, is the flow’s id. Each numbered step starts
with the place it happens; nested bullets are branches. See
Flows for the rest of the format.
The screen catalog lists the flows that use each screen, so it is now out of
date. lint --fix formats the sources and regenerates generated/ before it
checks:
starboard lint --fixwrote docs/flows/generated/screens.md0 errors, 0 warningsLook at a wireframe
Section titled “Look at a wireframe”generate keeps every wireframe under docs/flows/generated/wireframes/.
To draw one screen while you work on its layout, use render:
starboard render trip.timeline -o timeline.svgstarboard render trip.timeline --form-factor web-wide -o timeline-wide.svgwrote timeline.svgwrote timeline-wide.svgWithout -o, render prints the SVG. Without --form-factor, it draws the
screen’s first form factor, here phone.
Commit it
Section titled “Commit it”Commit starboard.yaml, .gitattributes and docs/flows/, generated pages
included: they are what people read on GitHub, and lint checks they match
the sources. Then check the reference in CI, so it cannot fall out
of date.
If you work with a coding agent, install Starboard’s skills next, so the agent edits the reference the same way: see Working with coding agents.