Skip to content
caliper ui pro docs

Generative renderer

Render a UI an assistant described as JSON through a registry you control: no HTML or scripts, unknown parts replaced by a marked placeholder while the rest renders, the spec and its problems one click away, and only allowed actions sent.

Pro

Answer from Halden Assistant

October refunds

Refunded€4,212−18% vs Sep
Requests37
Median time6h+2h
Largest refunds
CustomerReasonAmount
NorthwindDuplicate charge144
Lumen LabsDowngrade96
QuaysideService outage72

When to use

  • Assistants that answer with tables, metrics or actions instead of prose.
  • Agent output that needs to be safe to render.

When not to use

  • Fixed screens you design yourself; build them directly.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/generative-renderer

Adds its 6 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

validateUiSpec

0 props

No props of its own; it re-exports a primitive and takes that primitive’s props.

GenerativeRenderer

6 props
PropTypeDefaultDescription
spec *unknown—
registryUiRegistrydefaultUiRegistry
actionsreadonly string[]—Action names a button may send. Others are reported and ignored.
onAction((action: string, payload?: unknown) => void)—
labelstring"Generated view"
classNamestring—

defaultUiRegistry

helper

A helper exported alongside the component, not a component.

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It exposes region and alert semantics, with aria-label, aria-hidden, aria-labelledby and aria-pressed kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/generative-renderer.md

The index of every part is at /llms.txt.

More in Assistant screens