Skip to content

Interface: Block

Defined in: src/renderer/types.ts:42

A description of a UI component to render.

Produced by block functions (Bubble, Input, Text, …) and by callable component refs (imports from client/). Both produce the same shape — the browser resolves the component by type name.

Props may contain functions (e.g. validate, onChange). These are serialized to bridge callbacks by render before being sent to the browser.

Example

ts
// SDK block function
Bubble([Text({ content: 'Hello' })]);
// → { type: 'UiBubble', props: { draggable: true }, children: [{ type: 'UiText', … }] }

// Custom component (callable ref from client/)
MyChart({ data: [1, 2, 3] });
// → { type: 'MyChart', props: { data: [1, 2, 3] }, children: [] }

Properties

PropertyModifierTypeDescriptionDefined in
__kindreadonly"block"Discriminant marking this object as a Block. Set by createBlock() and callable refs.src/renderer/types.ts:44
typereadonlystringComponent name. Matches the component registry key or the client/ module name.src/renderer/types.ts:46
propsreadonlyRecord<string, unknown>Props passed to the component. May contain functions (serialized by render).src/renderer/types.ts:48
childrenreadonlyChildBlock[]Ordered children — nested Blocks, strings, numbers, or null.src/renderer/types.ts:50
key?readonlystringOptional key for list reconciliation.src/renderer/types.ts:52

Matterway Assistant SDK Documentation