Skip to content

Component Model

All components, visual and non-visual, share a common base JSON shape. Specific types add required or optional fields on top of this base.

FieldTypeRequiredDescription
idstringREQUIREDUnique identifier. MUST be globally unique across the entire unit — not just within a module.
typestring (enum)REQUIREDComponent type identifier. MUST be one of the supported types (see §3.2).
contextobjectOptionalComponent property dictionary. Values can be literals, state refs, context refs, or expressions.
styleobjectOptionalVisual and layout styling grouped by style domain (see §7).
childrenarrayOptionalNested child components. Leaf components may omit this field.
eventsobjectOptionalEvent handler dictionary: { eventName: [Action, …] } (see §9).

ℹ Note: id is mandatory on every component AND every action. IDs MUST be globally unique across the entire unit.

CategoryTypes
Contenttext, image, video, pdf, media, label, progress, color, map
Inputtextfield, texteditor, toggle, picker, slider, datepicker, button
Navigationnavigation, link, tab
Layoutvstack, hstack, zstack, scroll, spacer, divider, list, form, section, grid, gridrow
Shapescircle, ellipse, capsule, rectangle, roundedrectangle, star, bubble
Non-visualmodule, template, dynamic, conditional

ℹ Component type is matched case-insensitively. The canonical form is lowercase (the spellings above); a conforming runtime MUST resolve any casing — datepicker, datePicker, and DATEPICKER all select the same component. Convention: component types are lowercase; style domains (§7) are camelCase.