Declare each value in state. Use a flat map of strings, numbers and booleans.
02
Use "{{sessions}}" to show a value in heading, text, badge, card title or metric value. Quote strings that start with braces.
03
Set bind to a state key. An input edits a string; a toggle changes a boolean.
04
Any component can use when: details to appear only while the boolean state value details is true.
05
Buttons use increment or decrement for numbers, or toggle for booleans. Name the state key with target. The reset action restores all starting values and needs no target.
State keys start with a lowercase letter and use lowercase letters, digits or underscores. Component fields sit directly beside type. Unknown fields and missing or mismatched state keys produce a diagnostic.
03 Component catalog
12 building blocks.
Snippets belong inside view or a container’s children. Declare any referenced state keys in your document first.
01
stack
Stack
Arrange components vertically or horizontally.
childrenRequired
One to 30 nested components.
gap
Spacing: sm, md (default), or lg.
direction
Direction: vertical (default) or horizontal.
Component snippet
type: stack
gap: md
children:
- type: text
text: First component
type: card
title: Overview
children:
- type: text
text: Your content
04
heading
Heading
A section heading below the page title.
textRequired
Heading text; accepts {{key}} state text.
level
Heading level: 2 (default) or 3.
Component snippet
type: heading
text: Make it yours
level: 2
05
text
Text
Plain text with optional state interpolation.
textRequired
Plain text; accepts {{key}} state text.
tone
Text tone: default or muted.
Component snippet
type: text
text: Hello, {{name}}!
tone: muted
06
badge
Badge
A compact text label.
textRequired
Badge label; accepts {{key}} state text.
Component snippet
type: badge
text: Ready
07
metric
Metric
A prominent value with a descriptive label.
labelRequired
A short description of the value.
valueRequired
A quoted string; accepts {{key}} state text.
Component snippet
type: metric
label: Count
value: "{{count}}"
08
divider
Divider
A visual separator between groups.
Component snippet
type: divider
09
link
Link
An explicit HTTPS, email, or telephone link.
labelRequired
A meaningful link label.
hrefRequired
HTTPS, mailto:, or tel: only. No fragments or templates.
Component snippet
type: link
label: Read the guide
href: https://example.com/guide
10
input
Input
A text field bound to a string in local state.
labelRequired
Visible field label.
bindRequired
Existing state key whose value is a string.
Component snippet
type: input
label: Your name
bind: name
11
toggle
Toggle
A checkbox bound to a boolean in local state.
labelRequired
Visible checkbox label.
bindRequired
Existing state key whose value is a boolean.
Component snippet
type: toggle
label: Show details
bind: enabled
12
button
Button
Run one of four fixed local state actions.
labelRequired
Visible button label.
actionRequired
increment/decrement a number, toggle a boolean, or reset all state.
target
State key for the action. Required except for reset, which forbids it.
variant
Button appearance: primary (default) or secondary.
Component snippet
type: button
label: Add one
action: increment
target: count
04 Keep what you build
One working HTML file.
01
Save YAML keeps the editable source. Import it later to keep working.
02
Download index.html includes the interface and its local interactions. Open it directly or put it on a static host.
03
Export starts from YAML state. Changes made in the preview do not edit the source. Set the starting values in your YAML before downloading.
Local controls update values in the open document. They do not submit data or save changes after it closes. Links use HTTPS, email or telephone destinations.