Get Started
shadcn-rjsf is a set of three copy-paste registry items that bring JSON Schema–driven forms and a visual form builder to any shadcn/ui project.
Overview
The registry ships three items that work together:
form-builder-typeslibTypeScript types (FormSchema, FormFieldDefinition, etc.), the registerValidator API, and createCustomValidator. Both the renderer and builder import from here.
form-rendereruiA React component that accepts a FormSchema and renders it as a fully accessible, themed form using your existing shadcn/ui components.
form-builderuiA drag-and-drop visual editor with a live preview pane. Emits a FormSchema via onChange on every edit.
Prerequisites
- •shadcn/ui initialized in your project (
npx shadcn@latest init) - •Next.js 13+ (App Router) or React 18+ with a compatible bundler
- •Node.js 18+
Installation
Install in order — form-builder-types must be installed first because the other two depend on it.
form-builder-typesTypeScript types, validators, and shared utilities
Install this first — the other two depend on it.
form-rendererRenders a FormSchema as a live, accessible form
form-builderDrag-and-drop visual builder that emits a FormSchema
Quick Start: FormRenderer
Pass a FormSchema to FormRenderer and handle submissions via onSubmit.
Quick Start: FormBuilder
Wire FormBuilder to a FormRenderer for a live preview. The builder emits a full FormSchema on every change.
Locale Setup
Both components accept a locale and baseLocale prop.
| Prop | Type | Description |
|---|---|---|
locale | string | The active locale key (e.g. "en-US"). Used to resolve LocalizedString values. |
baseLocale | string | Fallback locale when the active locale has no translation for a string. |
If a LocalizedString is a plain string (not a locale map), it is always used as-is regardless of the active locale.