# Json Schema Form URL: /docs/web/components/json-schema-form Json Schema Form component with multiple variants and sizes. **Demo:** ```tsx 'use client'; // @custom-demo import { useState } from 'react'; import { JsonSchemaForm } from '@docyrus/ui/components/json-schema-form'; import { type JsonSchema } from '@docyrus/ui/components/json-schema-designer'; import { cn } from '@docyrus/ui/primitives/lib/utils'; import { Button } from '@docyrus/ui/primitives/ui/button'; const SAMPLE_SCHEMA: JsonSchema = { type: 'object', title: 'Project Intake', description: 'Capture a nested project brief with owners, preferences, and repeating milestones.', required: [ 'projectName', 'priority', 'owner', 'milestones' ], properties: { projectName: { type: 'string', minLength: 2 }, summary: { type: 'string', format: 'textarea', maxLength: 500, description: 'A concise overview that explains what the team is shipping.' }, priority: { type: 'string', enum: [ 'low', 'medium', 'high', 'critical' ], description: 'Four options or less render as a radio group.' }, stage: { type: 'string', enum: [ 'discovery', 'design', 'build', 'qa', 'launch', 'retrospective' ], description: 'More than four options automatically switch to a select field.' }, launchDate: { type: 'string', format: 'date' }, owner: { type: 'object', required: ['name', 'email'], properties: { name: { type: 'string' }, email: { type: 'string', format: 'email' }, timezone: { type: 'string' } } }, milestones: { type: 'array', minItems: 1, items: { type: 'object', required: ['title', 'dueDate'], properties: { title: { type: 'string' }, dueDate: { type: 'string', format: 'date' }, status: { type: 'string', enum: ['todo', 'in_progress', 'done'] } } } }, tags: { type: 'array', items: { type: 'string' }, description: 'Primitive arrays also use SchemaRepeater.' } } }; const SAMPLE_DATA = { projectName: 'Workspace Permissions', summary: 'Introduce scoped role assignments and delegated admin controls across workspace boundaries.', priority: 'high', stage: 'build', launchDate: '2026-06-15', owner: { name: 'Anil Beyazoglu', email: 'anil@example.com', timezone: 'Europe/Istanbul' }, milestones: [ { title: 'Access model approved', dueDate: '2026-05-30', status: 'done' }, { title: 'Admin console rollout', dueDate: '2026-06-10', status: 'in_progress' } ], tags: ['security', 'rbac', 'workspace'] }; export function JsonSchemaFormDemo() { const [mode, setMode] = useState<'create' | 'edit' | 'view'>('edit'); const [data, setData] = useState(SAMPLE_DATA); return (
{JSON.stringify(data, null, 2)}