Mote card
Start
card.md

Mote card

Examplea whole program
shape Todo
id: string
title: string
done: bool
state todos: Todo[] = [] persist
state draft = ""
derive left = todos.filter(t => !t.done).length
action 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=dim

Commands → 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 = 0
fn priceOf(job: string): number = job == "door" ? 4175 : 0
server 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=ask
text `${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 == me
local 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#

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