Skip to content
caliper ui pro docs

View composer

Describe a view and watch it assemble. Reasoning steps appear as they finish, placeholders hold the layout, then each tile fills in. A follow-up reshapes what is there instead of starting over: tiles that stay glide to their new place and their figures run to the new values.

Pro

Halden analytics

Ask a question and the view builds itself

Revenue reached $842k this quarter, up 12.4%. Orders grew more slowly than basket size, and refunds fell.

Revenue

$0k12.4%up, good vs last period

Orders

06.1%up, good vs last period

Average order

$0.005.9%up, good vs last period

Refund rate

0.0%14.3%down, good vs last period

Revenue by week

$80k Sep 28

Revenue by channel

  • Web54%
  • App28%
  • Marketplace18%
State

When to use

  • Assistants that answer with a screen rather than a paragraph.
  • Analytics tools where a question should change the view in place.

When not to use

  • A fixed dashboard that never changes; use the metrics dashboard.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/view-composer

Adds its 18 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

ViewComposer

7 props
PropTypeDefaultDescription
titlestring"Compose a view"
descriptionstring—
suggestions *readonly string[]—Prompts offered as buttons while nothing is being composed.
onCompose *(prompt: string, current: ComposeView | null) => Promise<ComposeView | null>—Turns a prompt into a view, given the one currently shown. Return null when there is nothing to show.
placeholderstring"Describe the view you want"
initial{ prompt: string; view: ComposeView; }—A view already on screen when the composer opens, with the prompt that made it.
classNamestring—

Keyboard

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

Accessibility

It exposes img and status semantics, with aria-label, aria-hidden, aria-current and aria-busy kept in step with state. Changes that matter are announced through a live region.

Motion

  • State changes animate with the library's shared durations and curves, so its timing matches every other part.
  • Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.

Notes for AI

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

/docs/components/view-composer.md

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

More in Metrics