Skip to main content

Block registry

Status: planned — the highest-leverage Arco milestone.

The block registry replaces implicit type unions and giant render switches with one manifest per block.

defineBlock() contract

Each block exports:

FieldPurpose
typeStable string identifier
schemaZod schema → runtime validation + JSON Schema
descriptionPrompt text for the AI
adaptivitySize classes, input profiles, reflow rules
examplesGolden samples for prompts, docs, and tests
render(props) => ReactNode mapping

Contract outputs (from one definition)

  1. Runtime validation — reject or repair malformed output before render
  2. JSON Schema / grammar — constrained decoding and tool arguments
  3. System prompt — generated vocabulary, never hand-maintained
  4. Design catalog — Storybook-style docs from examples
  5. Render mappingregistry[type].render

Two renderers, one registry

PathInputUse case
StreamingOpenUI Lang / A2UIChat inline blocks
StaticBlock JSONDurable apps, dashboards

Both resolve through registry[type].render.

Adaptivity descriptor

Blocks declare how they reflow across window size classes:

adaptivity: {
inputProfiles: ["pointer", "touch"],
minWidth: 220,
idealColumns: { compact: 1, medium: 2, expanded: 4 },
onCompact: "stack",
}

Size classes use CSS container queries — Compact / Medium / Expanded — not device types.

Roadmap phase

This is the Now phase in the Arco spec:

  • Registry + Zod for existing blocks
  • Generated system prompt from registry
  • Runtime validation + repair
  • OpenUI spike: two block types end-to-end
  • Design System workspace as living catalog

See the Arco spec overview for the full roadmap.