Skip to content
caliper ui pro docs

Form builder

Builds a working form: add fields from the palette, reorder by drag or Alt and arrows, set validation and show-when rules, then preview the real form and copy its schema.

Pro

Onboarding intake

9 questions · 2 with rules

Add a field

  1. About you
  2. Full name
  3. Work email
  4. Team size
  5. We are moving from another tool
  6. Which tool?Rule
  7. Seats neededRule
  8. When do you want to go live?
  9. Anything else
  10. What should we know?
  11. How likely are you to recommend us?

Alt and Up or Down moves the field. Delete removes it.

Section heading

Show this field

Always. Rules can use answers from fields above this one.

When to use

  • Surveys, intake and application forms your customers design.
  • Internal tools where operations staff change questions.

When not to use

  • A form you write once in code; use fields directly.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/form-builder

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

FormBuilder

4 props
PropTypeDefault
value *readonly FormFieldSchema[]—
onChange *(schema: FormFieldSchema[]) => void—
titlestring"Untitled form"
classNamestring—

FormPreview

3 props
PropTypeDefault
schema *readonly FormFieldSchema[]—
titlestring—
onSubmit((answers: Record<string, unknown>) => void)—

fieldVisible

10 props
PropTypeDefaultDescription
id *string—
type *FormFieldType—
label *string—
helpstring—
placeholderstring—
requiredboolean—
optionsreadonly string[]—For select.
minnumber—
maxnumber—
showWhenFormRule—Show this field only when another answer matches.

Keyboard

↑
Moves to the previous item or value.
↓
Moves to the next item or value.
Delete
Removes the next character or the selected item.
Backspace
Removes the previous character or item.
Enter
Activates the focused control.
Space
Activates the focused control.

Accessibility

It exposes button, status and alert semantics, with aria-label, aria-hidden, aria-pressed, aria-describedby and aria-invalid 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/form-builder.md

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

More in Settings & security