Form builder
ProBuilds 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.
pnpm dlx shadcn@latest add @caliper/form-builderOnboarding intake
9 questions · 2 with rules
Add a field
- About you
- Full name
- Work email
- Team size
- We are moving from another tool
- Which tool?Rule
- Seats neededRule
- When do you want to go live?
- Anything else
- What should we know?
- How likely are you to recommend us?
Alt and Up or Down moves the field. Delete removes it.
Section heading
When to use #
Use it for
- Surveys, intake and application forms your customers design.
- Internal tools where operations staff change questions.
Skip it when
- A form you write once in code; use fields directly.
Installation #
pnpm dlx shadcn@latest add @caliper/form-builder
Adds its 15 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.
Usage #
Import it from your copy of the source. The example behind the preview comes with the source. It is built from FormBuilder, FormPreview and fieldVisible.
import { FormBuilder, FormPreview, fieldVisible } from "@/components/ui/form-builder"
The worked example comes with Pro
The 22-line example behind the preview opens here with a Pro or Team licence.
API reference #
FormBuilder
component
FormPreview
component
fieldVisible
component
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.
Motion #
Transitions use the shared duration and easing tokens. Under prefers-reduced-motion those tokens collapse to instant and travel distances go to zero, so state changes still happen without movement.