Examples · Kanban board
A Trello-style kanban board: 42 lines of AppSPEC
A kanban board with drag-and-drop columns, an add-card form, an edit screen with delete, and a sortable list of every card. Create, move, update and delete are all declared on wires.
Running live in the sandbox with fixed demo data. Anything you add is saved in this browser; nothing leaves your device.
The state graph
3 screens, 3 wires
Screens are nodes and WIRE labels are edges. Screens in blue appear in the navigation; orange edges write a record on the way.
How it works
Walking through the spec
01Screens are states
3 screens, each a <STATE>. board, list appear in the navigation because they carry a NAV label. Children lay themselves out by containment: ROW, COL and GRID arrange them, and everything else stacks.
<STATE ID="board" NAV ICON="kanban">
…
<STATE ID="edit" WIDTH="640px">
…
<STATE ID="list" NAV="All cards" ICON="list">02Screens connect by label
Each <WIRE> names an action and where it leads; a button, card or row that fires the label follows it, taking the clicked record along. This app writes 1 wire out and uses the short forms OPEN, SAVE, UPDATE: OPEN="state" opens an item in that state, and FORM SAVE or UPDATE saves the form to a collection, with the engine adding the wire.
<FORM SAVE="cards" SET="status=todo" COLS="3">
…
<BOARD SRC="cards" COLUMNS="todo:To do,doing:In progress,done:Done" SUBTITLE="{owner}" BADGE="tag" OPEN="edit" />
…
<FORM UPDATE="cards" TO="board" COLS="2">
…
<TABLE SRC="cards" SORT="status" OPEN="edit">
…
<WIRE LABEL="remove" DELETE="cards" TO="board" />03Data flows through the key-value pipe
Every input publishes its value into the pipe under its ID, and every screen can read the pipe with {placeholders}. Writes are declared on wires: remove delete cards, add-card save cards, save-card update cards. SET adds key-value pairs to the record being written.
<FORM SAVE="cards" SET="status=todo" COLS="3">04One attribute sets the look
THEME="notion" sets every colour, radius and typeface. Change the word and the whole app restyles; all 31 themes work with every component.
<APP ID="kanban" NAME="Launch Board" THEME="notion" LOGO="kanban" WIDTH="1240px">Convention over configuration
What the engine infers
Every attribute this spec leaves out has a default inferred from names, data and context. These are the ones this app relies on; writing any of them out would override it.
- A WIRE
add-cardThe FORM SAVE="cards" implies this wire - A WIRE
save-cardThe FORM UPDATE="cards" implies this wire STATE NAV→BoardNAV with no label uses the state ID, humanisedFORM ACTION→add-card,save-cardSAVE wires the form to the collectionFORM SUBMIT-LABEL→Add card,SaveFrom SAVEFIELD LABEL→Tag,Owner,TitleFrom NAMEFIELD TYPE→selectIt has OPTIONSBOARD ACTION→editOPEN="edit" opens the clicked item in that stateBOARD TITLE→titleThe records have a title fieldBOARD GROUP→statusThe cards have a status field- A back linkA state opened with OPEN gets a back link
FIELD VALUE→{cards.title},{cards.status},{cards.tag},{cards.owner}The record being editedTABLE ACTION→editOPEN="edit" opens the clicked item in that stateCOL LABEL→Tag,OwnerFrom FIELD
What this would typically take
The pieces a conventional stack needs
A typical implementation of the same app assembles these parts, each with its own code, libraries and configuration. The size depends on the team and the tools, so we do not quote a number for it.
Here the same app is one 42-line document built from general-purpose components: BOARD, BUTTON, FORM, TABLE, TEXT, TOTAL.
| Drag and drop | A drag-and-drop library, drop targets per column and keyboard alternatives. |
|---|---|
| CRUD API | Endpoints to create, move, update and delete cards. |
| Forms | Add and edit forms prefilled from the selected card. |
| State | Keeping the board, the list view and the edit screen in sync. |
| Build tooling | A bundler, a dev server and a build configuration. |
The full speckanban.appspec · 42 lines
<APP ID="kanban" NAME="Launch Board" THEME="notion" LOGO="kanban" WIDTH="1240px">
<STATE ID="board" NAV ICON="kanban">
<ROW JUSTIFY="between">
<COL GAP="2px">
<TEXT STYLE="h1" TEXT="Launch board" />
<TEXT STYLE="muted" TEXT="Drag cards between columns, or use the arrows. Every change is a key-value write." />
</COL>
<TOTAL SRC="cards" WHERE="status=done" OP="count" LABEL="Done:" />
</ROW>
<FORM SAVE="cards" SET="status=todo" COLS="3">
<FIELD NAME="title" LABEL="New card" PLACEHOLDER="What needs doing?" REQUIRED />
<FIELD NAME="tag" OPTIONS="Planning,Design,Engineering,Marketing" />
<FIELD NAME="owner" PLACEHOLDER="Who?" />
</FORM>
<BOARD SRC="cards" COLUMNS="todo:To do,doing:In progress,done:Done" SUBTITLE="{owner}" BADGE="tag" OPEN="edit" />
</STATE>
<STATE ID="edit" WIDTH="640px">
<TEXT STYLE="h1" TEXT="Edit card" />
<FORM UPDATE="cards" TO="board" COLS="2">
<FIELD NAME="title" REQUIRED />
<FIELD NAME="status" LABEL="Column" OPTIONS="todo:To do,doing:In progress,done:Done" />
<FIELD NAME="tag" OPTIONS="Planning,Design,Engineering,Marketing" />
<FIELD NAME="owner" />
</FORM>
<BUTTON STYLE="danger" ICON="trash-2" LABEL="Delete" ACTION="remove" />
</STATE>
<STATE ID="list" NAV="All cards" ICON="list">
<TEXT STYLE="h1" TEXT="All cards" />
<TABLE SRC="cards" SORT="status" OPEN="edit">
<COL FIELD="title" LABEL="Card" />
<COL FIELD="status" LABEL="Column" TYPE="badge" />
<COL FIELD="tag" />
<COL FIELD="owner" />
</TABLE>
</STATE>
<WIRE LABEL="remove" DELETE="cards" TO="board" />
</APP><APP ID="kanban" NAME="Launch Board" THEME="notion" LOGO="kanban" WIDTH="1240px">
<STATE ID="board" NAV="Board" ICON="kanban">
<ROW JUSTIFY="between">
<COL GAP="2px">
<TEXT STYLE="h1" TEXT="Launch board" />
<TEXT STYLE="muted" TEXT="Drag cards between columns, or use the arrows. Every change is a key-value write." />
</COL>
<TOTAL SRC="cards" WHERE="status=done" OP="count" LABEL="Done:" />
</ROW>
<FORM COLS="3" ACTION="add-card" SUBMIT-LABEL="Add card">
<FIELD NAME="title" LABEL="New card" PLACEHOLDER="What needs doing?" REQUIRED="true" />
<FIELD NAME="tag" OPTIONS="Planning,Design,Engineering,Marketing" LABEL="Tag" TYPE="select" />
<FIELD NAME="owner" PLACEHOLDER="Who?" LABEL="Owner" />
</FORM>
<BOARD SRC="cards" COLUMNS="todo:To do,doing:In progress,done:Done" SUBTITLE="{owner}" BADGE="tag" ACTION="edit" TITLE="title" GROUP="status" />
</STATE>
<STATE ID="edit" WIDTH="640px">
<BUTTON STYLE="ghost" SIZE="sm" ICON="arrow-left" LABEL="Back" ACTION="back" />
<TEXT STYLE="h1" TEXT="Edit card" />
<FORM COLS="2" ACTION="save-card" SUBMIT-LABEL="Save">
<FIELD NAME="title" REQUIRED="true" VALUE="{cards.title}" LABEL="Title" />
<FIELD NAME="status" LABEL="Column" OPTIONS="todo:To do,doing:In progress,done:Done" VALUE="{cards.status}" TYPE="select" />
<FIELD NAME="tag" OPTIONS="Planning,Design,Engineering,Marketing" VALUE="{cards.tag}" LABEL="Tag" TYPE="select" />
<FIELD NAME="owner" VALUE="{cards.owner}" LABEL="Owner" />
</FORM>
<BUTTON STYLE="danger" ICON="trash-2" LABEL="Delete" ACTION="remove" />
</STATE>
<STATE ID="list" NAV="All cards" ICON="list">
<TEXT STYLE="h1" TEXT="All cards" />
<TABLE SRC="cards" SORT="status" ACTION="edit">
<COL FIELD="title" LABEL="Card" />
<COL FIELD="status" LABEL="Column" TYPE="badge" />
<COL FIELD="tag" LABEL="Tag" />
<COL FIELD="owner" LABEL="Owner" />
</TABLE>
</STATE>
<WIRE LABEL="remove" DELETE="cards" TO="board" />
<WIRE LABEL="add-card" SAVE="cards" SET="status=todo" />
<WIRE LABEL="save-card" UPDATE="cards" TO="board" />
</APP>