Appearance
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
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
__kind | readonly | "block" | Discriminant marking this object as a Block. Set by createBlock() and callable refs. | src/renderer/types.ts:44 |
type | readonly | string | Component name. Matches the component registry key or the client/ module name. | src/renderer/types.ts:46 |
props | readonly | Record<string, unknown> | Props passed to the component. May contain functions (serialized by render). | src/renderer/types.ts:48 |
children | readonly | ChildBlock[] | Ordered children — nested Blocks, strings, numbers, or null. | src/renderer/types.ts:50 |
key? | readonly | string | Optional key for list reconciliation. | src/renderer/types.ts:52 |