Start
Mote card
Examplea whole program
shape Todo id: string title: string done: boolstate todos: Todo[] = [] persiststate draft = ""derive left = todos.filter(t => !t.done).lengthaction add if draft.trim() == "" return todos.push({id: uid(), title: draft, done: false}) draft = ""column gap=8 padding=16 row gap=8 input value=draft placeholder="What next?" submit=add button "Add" press=add for t in todos key=t.id row gap=8 align-items=center input type=checkbox checked=t.done text t.title color=(t.done ? "dim" : "fg") button "×" press={todos.remove(t)} text `${left} left` color=dimCommands → docs/cli.md#
Declarations → docs/language.md#
Types and logic → docs/language.md#
A call that can fail → docs/language.md#
Markup → docs/markup.md#
Events → docs/events.md#
When things run → docs/reactivity.md#
A back end → docs/back-end.md#
Examplea whole program
state job = "door"state price = 0fn priceOf(job: string): number = job == "door" ? 4175 : 0server fn quote(job: string): number requires anyone if priceOf(job) == 0 fail("no such job")? return priceOf(job)action ask price = quote(job)?button "Quote" press=asktext `${price} ${failure(ask) ?? ""}`Models → docs/models.md#
Examplea whole program
model Room name: string unique owner: id = me read anyone add if me != none change, remove if owner == melocal model Draft room: string unique text: string = ""live rooms: Room[] = Room.find({}, {order: "name"}) else []resource drafts: Draft[] = Draft.find({}) else []action make(name: string) let r = Room.add({name})? Draft.add({room: r.id})?for r in rooms key=r.id text `${r.name} ${drafts.find(d => d.room == r.id)?.text ?? ""}`button "Make" press=make("den")The standard library → docs/README.md#namespaces#
The kit → docs/kit.md#
For agents and tests → docs/agents.md, docs/testing.md#
Refused, with the fix in the message#
Edit this page:
docs/card.md