PlaybooksWalk a flow⌄
Walk a flow
A link between frames is one line in a frame's code. Click it and you walk to the next frame, so a set of frames plays like the app they will become.
A project with a few frames that belong to one journey. The examples use kaffe's menu, cart and receipt.
- 1
Link the frames
A frame walks to another by its name, which is its path under
frames/. Ask your agent to link them, or write it yourself:data-goon any element walks there on click, andui.gowalks from code.askLink menu to cart from the Checkout button, and cart to receipt from Pay.design/frames/cart/frame.tsximport { ui } from "spool"; <button data-go="receipt">Pay</button> <button onClick={() => ui.go("menu")}>Add more</button> - 2
Read the arrows
The canvas draws an arrow for every literal walk in a frame's folder, from the element that causes it. An arrow is solid when the walk always happens and faint when it sits inside a condition.
spool flowsprints the same graph, and names any destination it could not read.~/kaffe $ spool flows - 3
Walk it on the canvas
Click into
menuand press Checkout. The walk lands oncart, live, with the session it carried. A walk to a frame on another page docks as a tag naming it, and pressing the tag goes there. - 4
Play the whole flow
Press Play on a frame's name, or
Pwith it selected, and the player opens in a tab of its own. It plays the journey as one document, at the frame's own width, and each walk is a crossfade unlessshared/transitions.csssays otherwise. Every load is a fresh session, so reload to start over.