The page
The kit
The page
kit.md

The kit

Examplea whole program
state name = ""
state agree = false
state plan = "Free"
state asking = false
action save
toast("Saved", name)
asking = false
column gap=12 padding=24 max-width=420
Card title="Account" description="A few details."
Label "Name"
Input value=name placeholder="Ada Lovelace"
Select value=plan options=["Free", "Pro"]
Checkbox "I agree" checked=agree
Button "Save" press={asking = true} disabled=(!agree)
Dialog open=asking title="Save it?" description="You can change it later."
row gap=8 justify-content=flex-end
Button "Cancel" press={asking = false} variant="outline"
Button "Save" press=save

Mental model#

The everyday components#

Driven switches#

Examplea whole program
shape Channel
id: string
muted: bool
state channels: Channel[] = [{id: "general", muted: false}]
state wifi = true
action mute(id: string, on: bool)
// (Ask the back end here; the switch moves when the row does.)
let c = channels.find(c => c.id == id)
if c != none c.muted = on
column gap=8 padding=16
Switch on=wifi
for c in channels key=c.id
Switch value=c.muted change={mute(c.id, it)}
Checkbox "Muted" value=c.muted change={mute(c.id, it)}
Toggle "M" value=c.muted change={mute(c.id, it)}
Examplea whole program
state tab = "Profile"
state wifi = true
state volume = 40
state city = ""
state page = 1
action rename
toast("Renamed")
column gap=12 padding=24 max-width=480
Tabs value=tab options=["Profile", "Sound"]
if tab == "Profile"
Combobox value=city options=["Oslo", "Rome", "Lima"] placeholder="City"
Button "Options" variant="outline"
Menu
MenuItem "Rename" press=rename
else
Switch on=wifi
Slider value=volume min=0 max=100 step=1
Progress value=volume
Separator
Pagination page=page pages=9

The index#

Pitfalls#

Where a new component goes#

In the source#

esc
1072 sections of 111 pages, ranked as you type.A heading's words count for more than what stands under it.
↑↓move
↵open
ranked by BM25, in the page