State
Values, props, stores, and bindings.
Values and props
A prop supplies a value to an element or component. A literal holds the value directly: "Hello", 42, true.
Stores
A store declares fields and actions. Its scope is an app, page, or component.
{{stores.user.name}} reads the name value from the user store.
Expressions
An expression computes a value from the current context.
{{stores.user.name}}
{{props.title}}
{{repeat.item}}
{{hooks.rsvpForm.values.email}}
{{session.user.email}}
{{page.search.eventId}}Mixed text interpolates: Hello {{stores.user.name}}.
Bindings
A binding references a target. A component binding can supply props. A function binding can supply arguments.
Component: { componentId, instanceProps }
Function: { functionId, instanceParams }
Element: { elementId }Component props
The component interface declares the inputs. The instance supplies the values. Expressions inside the component read {{props.<name>}}.
Route and session values
page supplies route values. session supplies the current viewer's session.
External data
A useQuery hook fetches data. Expressions read its outputs through {{hooks.<alias>.<path>}}.
Fields, interfaces, and schemas
A field has a name and type. An interface is a list of fields. A schema names an interface for reuse within an app.
Types
Types describe the values a field accepts.
| Type | Kind | Shape | Description |
|---|---|---|---|
Type.Text | text | { kind, flavor? } | String. flavor is "inline" or "rich". |
Type.Number | number | { kind } | Number. |
Type.Boolean | boolean | { kind } | Boolean. |
Type.Date | date | { kind } | Date. |
Type.File | file | { kind, accept? } | File value { fileId, name?, format? }. accept is a MIME glob (image/*, video/*). |
Type.Object | object | { kind, fields } | Nested record. fields is a field list. Holds a value of a shape. |
Type.Array | array | { kind, item } | List. item is any nested type. |
Type.Ref | ref | { kind, refId } | An app schema. |
Type.And | and | { kind, operands } | Intersection. Last operand wins on the same field name. |
Type.Or | or | { kind, operands } | Type-level union (string | string[] | void). No stored discriminator. |
Type.OneOf | oneof | { kind } plus field discriminator / variants | Form toggle-group: named variants, each with fields. Distinct from or. |
Type.Element | element | { kind } | { elementId }. A ref to a node in the tree. |
Type.Component | component | { kind } | { componentId, instanceProps? }. |
Type.Function | function | { kind, params?, returns?, async?, identity? } | A callable. The value is a function call { functionId, instanceParams?, when? }. |
Type.RenderProp | renderprop | { kind, params } | The element's children are the callback body; declared params bind as {{render.<name>}}. Return is rendered, not consumed as a value. |
Type.Void | void | { kind } | Nothing. Only meaningful as a callable's returns. Distinct from omitted returns (undeclared). |
Type.Interface | interface | { kind } | The value is a field list (a shape). Object holds a value of a shape; Interface holds the shape. |