The page
The kit
Examplea whole program
state name = ""state agree = falsestate plan = "Free"state asking = falseaction save toast("Saved", name) asking = falsecolumn 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=saveMental model#
The everyday components#
Driven switches#
Examplea whole program
shape Channel id: string muted: boolstate channels: Channel[] = [{id: "general", muted: false}]state wifi = trueaction 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 = oncolumn 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 = truestate volume = 40state city = ""state page = 1action 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=9The index#
Pitfalls#
Where a new component goes#
In the source#
Edit this page:
docs/kit.md