This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index at /llms.txt, or add .md to any page's URL.
ebnf
node = element | component-use | view-if | for | view-match | children ;
element = TAG { attribute | expr | special-word } NL [ element-body ] ;
attribute = FIELD "=" expr | "autofocus" ;
element-body = INDENT { continuation | element-part } { node } DEDENT ;
continuation = FIELD "=" expr { attribute } NL ;
element-part = "::" "placeholder" NL block(continuation) ;
component-use = CAPITALIZED_IDENT "(" [ named-args ] ")" NL [ node-children ] ;
named-args = FIELD "=" expr { "," FIELD "=" expr } [ "," ] ;
node-children = INDENT node { node } DEDENT ;
view-if = "if" expr block(node) [ "else" ( view-if | block(node) ) ] ;
for = "for" IDENT [ "," IDENT ] "in" expr "key" "=" expr block(node) ;
view-match = "match" expr block(view-case) ;
view-case = "case" "some" "(" IDENT ")" block(node)
| "case" "none" block(node) | "case" STRING block(node) ;
children = "children" NL ;
special-word = "document" | "switch" | "multiple" ;
special-word is contextual: scroll document, and the admitted input forms, not three universal positional flags. The lowering pass restricts an element's positional values, children, and properties. button "Label" inserts a text child. autofocus is the bare boolean convenience spelling.
A deeper element line is treated as an attribute continuation only when it starts with name=; once child nodes begin, later lines are children, not continuations. Continuations may sit deeper than the children that follow them; fmt moves them to the children's level. A repeated attribute on one element is refused. A component use takes named arguments; its name starts uppercase to distinguish it from an element.
A for key is a string, number, or boolean, with unique stable values required for useful row identity. Its optional second binding is the numeric row index. if conditions are boolean. Match an option with case some(value) and case none. Match page.platform with a quoted host name per case. Root regions are refused: wrap them in an element. children requires a declared slot.
Is this helpful
Last updated November 30, 2026
Exact Docs