Dynamic Blocks
Full React blocks with hooks and state (experimental)
Experimental. For most use cases, static blocks are recommended — they’re faster, automatically adapt to multiple sizes, and require no boilerplate.
Dynamic blocks let you write full React components with hooks, state, and effects. They render in a sandboxed iframe at roughly 400x600px and work on both mobile and web.
Basic UI
The default export defines your block’s interface. Import layout components
from start/ui:
Layout components
start/ui exports layout and text components:
XStack— horizontal flex containerYStack— vertical flex containerZStack— absolute positioned stackSizableText— text with size scaling (recommended)View,ScrollView,Separator,Spacer,ThemeH1–H6,Paragraph,Circle
Shorthands
Shorthand props available on all layout components:
| Short | Property |
|---|---|
p, px, py, pt, pb, pl, pr | padding |
m, mx, my, mt, mb, ml, mr | margin |
bg | backgroundColor |
rounded | borderRadius |
items | alignItems |
justify | justifyContent |
grow, shrink | flexGrow, flexShrink |
self | alignSelf |
z | zIndex |
useData hook
Query workspace data from your UI. Returns live results that update in real time:
Filter params
| Param | Type | Description |
|---|---|---|
kindFilter | string | Filter by kind |
statusFilter | string | Filter by status |
keyFilter | string | Search keys (case-insensitive) |
appIdFilter | string | Filter by app install |
channelId | string | Filter by channel |
sortColumn | string | Column to sort by |
sortDirection | string | 'asc' or 'desc' |
limit | number | Max results (may be capped) |
The hook returns a [data, actions] tuple where actions includes mutate
and delete methods.
useBlockContext hook
Adapt your layout based on how the block is being rendered:
Safety
Dynamic blocks have built-in safety: they don’t run when closed, error boundaries catch crashes, and excessive re-renders are throttled.