JSON Forms Extended

Renderer Set and Demo Application Specification

This is the maintained renderer and demo acceptance guide. It complements spec.md, especially §30, and the renderer selection guide. The authoring-schema audit explains the archived sources. Portable data and option semantics are governed by spec.md when wording differs.

For implementation traps and cross-platform acceptance checks, also read the implementation guide and pitfalls.

1. Purpose

This document is the implementation and acceptance specification for every renderer set and renderer demo in an implementation. It is intended to make a new UI-library integration predictable: the JSON Forms behavior and demo features remain consistent, while the visual language and component APIs come from the selected UI library.

The specification has two distinct contracts:

  1. The demo application contract defines the common application structure, navigation, editors, settings, responsive behavior, and Framework-native/Web Component switching.
  2. The renderer contract defines how JSON Schema, UI Schema, data, validation, and configuration must map to controls from a UI library.

The UI library is the source of truth for component appearance, interaction, and API usage. Existing JSON Forms demos can inform feature coverage and information architecture; they are not a reason to replace native library components with generic imitations.

2. Normative language

The terms MUST, MUST NOT, SHOULD, and MAY describe requirements:

3. Core principles

3.1 UI-library fidelity

3.2 File ownership and structure

3.3 Behavioral parity

4. Workspace architecture

Keep the base renderer registry, optional extended registry, demo application, and optional browser Web Component independently consumable. Share framework behavior below UI-family adapters, and share demo state separately from rendering. The names and directory layout are implementation choices.

5. Tooling contract

Use the framework's supported build, type-check, test, development-server and preview tools. Document reproducible commands and keep dependency lockfiles current. A renderer's integration tests MUST exercise its public registries. Vite, Vitest and pnpm are optional tooling choices, not requirements for other frameworks or languages.

6. Demo application layout

6.1 Desktop information architecture

The desktop application follows this structure:

┌──────────────────────────────────────────────────────────────────────┐
│ Menu  Library logo + JSON Forms <UI> <framework>      View/tools/settings │
├───────────────┬──────────────────────────────────────────────────────┤
│ Search        │ Example title                                        │
│               │ ┌──────────────────────────────────────────────────┐ │
│ Example list  │ │ Demo and Data | Schema | UI Schema | ... Config │ │
│               │ ├──────────────────────────────────────────────────┤ │
│ Active item   │ │ JSON Forms                         Actions        │ │
│ highlighted   │ │ ┌────────────────────────┬─────────────────────┐ │ │
│               │ │ │ Demo form              │ Data editor         │ │ │
│ Scrolls       │ │ │                        │ Reload / Apply      │ │ │
│ independently │ │ └────────────────────────┴─────────────────────┘ │ │
│               │ └──────────────────────────────────────────────────┘ │
└───────────────┴──────────────────────────────────────────────────────┘

6.2 Header tools

The header MUST provide, in this logical order:

  1. Form-only/full-UI toggle.
  2. Framework-native/Web Component toggle when a Web Component is available.
  3. Repository link.
  4. Theme customization/settings entry points.

The Framework-native/Web Component toggle is a top-level application action. It MUST NOT also appear in the settings panel. It MUST use the Web Components logo rather than a generic package, cube, or framework icon. The logo's foreground MUST remain legible in light and dark themes, and it SHOULD use the same Y-axis spin animation while Web Component mode is active. Reduced-motion preferences MUST disable that animation.

Each icon-only action MUST have an accessible name, tooltip or title, pressed state where applicable, and visible keyboard focus.

6.3 Sidebar

6.4 Responsive behavior

7. Demo views and behavior

7.1 Home view

The home view MUST include:

Logos MUST remain legible in light and dark mode. SVGs that use currentColor SHOULD be rendered inline when theme inheritance is required.

7.2 Example workspace

The workspace MUST expose these tabs:

The Demo tab label MUST display the current validation error count when the count is greater than zero.

Example-specific actions MUST appear on the same row as the JSON Forms heading and MUST use the selected UI library's buttons.

7.3 Demo and Data layout

The preferred desktop layout starts at approximately 75% form and 25% data editor:

7.4 JSON editors

7.5 Form-only mode

8. Settings specification

Settings MUST appear in an end-side drawer or equivalent UI-library overlay. The overlay MUST have a heading, concise explanation, close action, scrollable content, focus management, and a dismissible backdrop.

8.1 Common settings

Every demo MUST support:

Setting Values/default Required behavior
Mode System, Light, Dark; default System System follows prefers-color-scheme; editors and forms update immediately.
Direction LTR, RTL; default LTR Applies to shell, form, overlays, and Web Component.
Locale English, German, Bulgarian, browser locale Updates JSON Forms internationalization without resetting data.
Validation Validate and show, Validate and hide, No validation Maps directly to JSON Forms validation modes.
Demo Layout Default, Demo and Data Changes presentation only.
Restrict Default on Enforces schema length, array size, and related restrictions.
Read-only Default off Disables mutation while preserving readable values and navigation.

The common options section MUST also expose:

Option names and descriptions SHOULD remain consistent across demos.

8.2 UI-library settings

Each renderer demo MAY add provider or theme settings specific to its library, for example accent color, density, component size, border radius, or theme algorithm.

8.3 Settings persistence

The demo host MUST remember the settings that describe a user's durable visual preferences:

Persistence MUST be exposed through a small platform storage abstraction and MUST NOT be coupled directly to a browser API inside renderer components. The web demo uses localStorage by default. Android, iOS, desktop, and other hosts MAY provide their platform preference store instead; such hosts are not required or expected to emulate localStorage. Both synchronous web storage and asynchronous native storage adapters SHOULD be supported. Missing, blocked, unavailable, or corrupt storage MUST fall back to defaults without preventing the form from rendering.

Direction, validation mode, and the generic JSON Forms configuration toggles are session settings and are not persisted by default. Read-only state and top-level view state are represented in the URL as described below. A host MAY persist additional settings only when its product requirements explicitly call for that behavior.

Storage keys MUST be scoped by renderer demo so UI-library-specific settings cannot leak into another renderer set. Stored data SHOULD carry a schema version so future implementations can migrate or safely discard old values.

8.4 URL query contract

Demo URLs MUST support these query parameters:

Parameter Values Default/behavior
read-only true, false false; controls JSON Forms read-only mode.
form-only true, false false; switches the top-level form-only view.
active-tab demo, schema, uiSchema, uiSchemas, internationalization, config, data demo; selects the workspace tab.
use-webcomponent true, false false; selects the Web Component host when one is available.
drawer true, false Viewport-dependent; controls whether the example drawer is open.

For compatibility with different routers, implementations MUST read supported parameters from either the normal URL query or the query portion following the example hash. Hash-query values take precedence when both are present. Web demos that use the hash as the example route SHOULD write the canonical form:

/#mixed?form-only=true&active-tab=schema

Writers SHOULD omit values equal to their defaults, preserve unrelated query parameters, and normalize a supported parameter to one location when the user changes it. Only the literal value true enables a Boolean parameter. Browser back/forward navigation and direct URL loading MUST update the corresponding view without resetting the selected example or its data.

Example hash routes MUST be percent-encoded when written and decoded before matching an example name. Labels or legacy example identifiers containing spaces or other reserved URL characters MUST therefore open on the first selection and remain selected after hashchange or browser navigation.

9. Renderer behavior contract

9.1 Common control anatomy

Every control SHOULD use this visual order:

  1. Label and required indicator.
  2. Input/control.
  3. Description or helper text.
  4. Validation message.

Requirements:

9.1.1 Clear actions

Editable controls that can hold a scalar or textual value SHOULD provide a compact icon-only Clear value action. This includes, where applicable, text inputs, textareas, password and masked inputs, number and integer inputs, date/time inputs, editable comboboxes, enum dropdowns, one-of enum dropdowns, full oneOf selectors, and mixed-type selectors.

9.2 Primitive controls

The base renderer set MUST cover:

Numeric controls MUST preserve numeric values rather than returning strings. Integer controls MUST prevent or reject fractional values according to the UI library and JSON Forms conventions.

Enum controls MUST preserve the original option values, including numeric and boolean enum values, and MUST display translated labels when available.

Selection controls MUST represent an absent value as genuinely unselected:

9.3 Date and time controls

9.3.1 Display and storage formats

Date, time, and date-time controls MUST support distinct display and storage formats supplied through the applied UI Schema options. The established option names are:

Schema format Display option Storage option
date dateFormat dateSaveFormat
time timeFormat timeSaveFormat
date-time dateTimeFormat dateTimeSaveFormat

The display option controls how the value appears in the input and picker. The storage option controls the string emitted to JSON Forms through handleChange. For example, a date may be displayed as MM/DD/YYYY while the data model stores YYYY-MM-DD.

The renderer set MUST document which formatting token syntax it accepts. If the UI library uses a different token system, the integration layer MUST map the established UI Schema option values consistently or document the supported syntax without changing the option names.

9.4 Objects and groups

9.5 Arrays

9.6 Dynamic object properties

Dynamic object-property support includes patternProperties and propertyNames; it is not limited to the additionalProperties keyword. The renderer MUST provide:

Actions SHOULD use recognizable add, edit, and delete icons rather than large text buttons when the UI library's pattern is icon-based.

9.6.1 Property-name validation

For example, the following object accepts keys such as string_title and number_count, renders a different value control for each prefix, and rejects every other dynamic key:

{
  "type": "object",
  "propertyNames": {
    "pattern": "^(string|number)_[A-Za-z0-9_]+$"
  },
  "patternProperties": {
    "^string_": { "type": "string" },
    "^number_": { "type": "number" }
  },
  "additionalProperties": false
}

patternProperties keys are regular expressions rather than literal prefixes or glob expressions. They are not implicitly anchored, so schema authors must use ^ and $ when a full-name match is intended.

9.6.2 Selecting the dynamic value schema

For each property name, the renderer MUST determine the value schema according to JSON Schema semantics:

  1. A schema in properties applies to an explicitly declared name. Declared names are reserved and MUST NOT also appear as additional-property rows.
  2. Every schema in patternProperties whose regular expression matches the property name applies. If several patterns match, all matching constraints MUST be composed; selecting only the first match is insufficient.
  3. additionalProperties applies only when the name is not covered by properties or any patternProperties entry. Its schema may be true, false, an object schema, or a $ref.
  4. When additionalProperties is absent, JSON Schema treats additional values as allowed. The renderer MUST expose the unrestricted Add action when the applied option allowAdditionalPropertiesIfMissing is enabled; matching patternProperties entries remain available independently of that option. Existing dynamic data MUST still render even when the option is disabled.

All applicable $ref values MUST resolve against the root schema. The selected or composed schema determines the value renderer and the default value created by Add. Object, array, primitive, null, and mixed schemas MUST retain their correct JSON data types.

If a rename changes which pattern schema applies, the value MUST be rendered and validated against the newly applicable schema without silently coercing, discarding, or replacing the existing value.

9.6.3 Mutation and synchronization

9.7 Combinators and references

The base renderer registry MUST correctly support:

Rules:

9.8 Mixed-type renderer

A mixed-type renderer handles a schema that genuinely permits more than one JSON data type, including an array-valued type and unrestricted schemas such as items: true. It MUST NOT claim an allOf, anyOf, oneOf, ordinary object, or other schema for which a more specific renderer exists.

The renderer MUST derive its available choices from the resolved schema. Its selection MUST follow the current data type, with JSON Schema number accepting integer data. Selecting a different type MUST replace the value with a schema-derived initial value of that type; it may still require user completion. A registered per-type detail UI Schema, such as object-detail or array-detail, MUST be honored.

When deriving that value, a schema default MUST be used only when its runtime JSON type is compatible with the newly selected type (integer is compatible with number). An incompatible default from another allowed branch MUST be ignored. For example, changing a schema with type: ['object', 'boolean'] and default: true to object must create the schema-derived object default rather than immediately restoring true and switching the selector back to boolean.

9.8.1 Primitive presentation

When the selected value is a primitive or null, the mixed renderer MUST look and behave like a normal one-line form control:

9.8.2 Object and array presentation

When a root mixed value is an object or array, it MUST use a UI-library-native collapsible panel or accordion. The header MUST retain the type selector at the inline-start followed by the field label. Selecting an object or array from a primitive state SHOULD open the panel automatically.

The expanded panel MUST contain two resizable panes, initially approximately 25% tree and 75% detail:

  1. The inline-start pane is a searchable, expandable tree of the current data.
  2. The inline-end pane renders the control for the selected tree node.

The collapse/expand action SHOULD be positioned at the inline-end of the header. The selected type MUST NOT be repeated as a second header label (for example, array followed by another array); only a distinct field label may follow the type selector.

The tree and detail panes MUST provide the following behavior:

9.8.3 Visual acceptance layout

At desktop widths, implementations SHOULD match the following composition. The notation describes placement, not literal text or a required visual style:

Primitive value
Field label
[ compact type selector ][ value control fills remaining width ]

Absent value
Field label
[ full-width type selector                                      ]
[ validation feedback                                           ]

Object or array value
[ compact root type selector ][ distinct field label ] [ collapse action ]
┌───────────────────────── resizable split ──────────────────────────────┐
│ Search tree...          │ [root type icon] / Property / Item N         │
│ root type icon   [eye]  │                                             │
│   child type icon Label │ selected primitive:                         │
│   child type icon Label │ [ compact type selector ][ value control ]  │
│                         │                                             │
│                         │ selected object/array:                      │
│                         │ [ compact type selector ]                   │
│                         │ [ regular object/array detail renderer ]    │
└────────────────────────────────────────────────────────────────────────┘

The structured root occupies the tree's type-icon position and has no Value, {}, or [] text label beside it. Only the root breadcrumb uses a type icon, because it has no path label. All later breadcrumb segments use only their property name or Item N label. Clickable ancestors use the UI library's link cursor and interaction states; the current segment does not.

Within a regular object or array renderer, a nested mixed object or array is a compact control with this structure:

Field label
[ compact type selector ][ View icon ]
[ description or validation feedback    ]

The label and feedback wrap the complete row, while the selector and View icon are flex/grid siblings aligned by the row itself. Their alignment MUST remain correct when labels wrap, typography changes, feedback appears, or a host supplies a custom control wrapper. The control does not embed another mixed tree/detail panel. A dynamic property is laid out as one property label with its Rename/Delete icon actions, followed by the same aligned mixed-value row; the primitive input MUST NOT introduce a second copy of the property label.

At narrow widths, selector/value rows stack to one column with the type selector above the value control. Implementations MAY stack the tree and detail panes or provide another platform-native responsive presentation, but all navigation, selection, editing, and action behavior MUST remain available.

The tree MUST use appropriate tree, treeitem, expansion, and selection semantics. Tree rows, disclosure controls, type selection, breadcrumbs, and item actions MUST be keyboard accessible.

9.9 Layouts

The base renderer set MUST include:

When supported by the renderer family, it SHOULD also include categorization steppers and list-with-detail layouts.

Layouts MUST preserve child visibility, enabled/read-only state, paths, renderer/cell registries, and responsive behavior.

9.10 Extended renderers

Extended renderers are optional additions to the base registry, but a new renderer family SHOULD provide UI-library-native implementations for the extended examples it enables. Current extended capabilities include:

An extended renderer MUST live in its own file and MUST have a tester whose rank does not accidentally override unrelated base schemas.

9.10.1 Monaco editor renderer

The Monaco renderer is an opt-in code editor selected by UI Schema options. It MUST use Monaco Editor itself and MUST NOT replace it with a textarea styled to look like a code editor.

The established selection and value options are:

Option Meaning
format: "code" Opts the control into code-editor rendering.
language Sets a fixed Monaco language identifier.
:language Resolves the Monaco language identifier from a root-data path.
convertJson Pretty-prints JSON-compatible data and parses editor text back to JSON.
monaco.rows Sets the normal fixed editor height in text rows.
monaco.autoGrow Grows the editor with its content.
monaco.minRows / monaco.maxRows Clamp auto-growing editor height.
monaco.options Passes supported standalone-editor construction options through to Monaco.
monaco.initActions Runs named Monaco actions after initialization.

The renderer MUST use the normal control wrapper for label, description, required state, errors, focus, and accessibility. Disabled and read-only state MUST make Monaco read-only and MUST prevent edits from reaching JSON Forms. Validation state MUST remain visible around the editor without obscuring Monaco's own diagnostics.

The editor MUST support a maximize/restore action, restore with Escape while maximized, and recalculate its layout after container, pane, row-count, or maximize changes. Auto-grow MUST count model lines and remain within the configured minimum and maximum. Multiple editor instances MUST maintain independent values, languages, options, heights, focus, and disposal.

9.10.2 Monaco theme and Web Component behavior

9.10.3 Runtime applicability of web-specific renderers

AG Grid, Monaco Editor, and template/named-template/slot renderers are web-platform integrations. They are expected for renderer families targeting a browser, including React, Svelte, Vue, Lit, and browser-targeted variants of other languages or frameworks.

They are not required for renderer sets targeting a native, non-web runtime, such as Flutter native applications, Kotlin/JVM or Compose native UI, Swing, SWT, iOS, or Android views. Those renderer sets MAY omit these extensions or provide documented native equivalents, such as a native data grid, code editor, or composition/template mechanism. They MUST NOT claim exact AG Grid, Monaco, or DOM-template compatibility unless the actual web implementation is hosted. Applicability is determined by the deployment runtime, not solely by the implementation language: a Kotlin or Flutter browser target may still implement the web contract.

10. Cells

Renderer sets that support table or compact array presentation MUST provide cells for the applicable primitive types:

Cells MUST preserve value types and read-only/disabled behavior. A cell MAY be visually denser than a full control but MUST use the UI library's components.

11. Tester and registry rules

12. Web Component parity

The Web Component is another host for the same renderer set, not a simplified renderer implementation.

13. Theme, RTL, and accessibility

13.1 Theme

13.2 RTL

13.3 Accessibility

14. Testing specification

Tests exist to validate JSON Forms integration and application contracts, not to retest the upstream UI library.

14.1 What to test

Each renderer SHOULD test:

Complex renderers MUST test data-shape preservation. Required regression cases include:

14.2 What not to test

An upstream component test is justified only when the implementation repository modifies the component or depends on a specific integration detail that could regress.

14.3 Required verification

Before a renderer-set change is considered complete:

  1. Run focused tests for the changed renderer.
  2. Build the base renderer package.
  3. Build the extended renderer package when affected.
  4. Build the Web Component package when affected.
  5. Build the corresponding demo with its documented toolchain.
  6. Run the implementation repository’s documented test command.
  7. Run formatting and git diff --check.
  8. Visually inspect representative examples in light, dark, RTL, responsive, framework-native, and Web Component modes when browser testing is available.

15. New renderer-set implementation sequence

  1. Inventory the UI library. Identify its provider, theme system, icons, form controls, pickers, layouts, overlays, tables, and accessibility APIs.
  2. Create the base renderer package. Keep renderer, cell and reusable component responsibilities clear under the platform's source conventions (§3.2).
  3. Implement primitive controls. Establish labels, descriptions, errors, value conversion, and read-only behavior first.
  4. Implement layouts and complex renderers. Include objects, arrays, dynamic properties (patternProperties, additionalProperties, and propertyNames), $ref, and combinators before relying on a mixed fallback.
  5. Add cells. Cover every compact/table type supported by the examples.
  6. Create extended renderers. Use the UI library for every visual control; reuse only genuinely UI-independent behavior.
  7. Create the Web Component. Reuse the same registries and package the real styles for its Shadow DOM.
  8. Create the independent demo app. Supply the library shell, demo UI controls, logo, provider settings, and theme wrapper to the shared demo layer.
  9. Add the app to the aggregate selector. Keep its build output isolated in its own subdirectory.
  10. Add integration tests and run the acceptance checklist. Test schemas through the full registry and verify that data shapes never depend on the selected renderer family.

16. Acceptance checklist

A new renderer set is ready when all answers are yes:

17. Source-of-truth priority

When references disagree, use this order:

  1. JSON Schema and JSON Forms semantics for data and validation behavior.
  2. The selected UI library's official API and components for appearance and interaction.
  3. This guide for host architecture and demo behavior. spec.md remains authoritative for portable semantics.
  4. Existing renderer demos and implementations as visual and feature references.

Any intentional deviation MUST be documented in the renderer package README and covered by a test when it changes observable behavior.

Component ownership

When a UI library distributes component source, consuming hosts own those components and keep them aligned with their chosen upstream version. Renderers use a documented component interface rather than shipping competing private copies. Native and Web Component hosts must both supply the real component styles and dependencies. Framework-specific aliases and filenames belong in implementation setup guides.

Catalog registration and validation summary

Demos MUST discover specification examples from the spec package catalog or example module, without a second per-example registry in each renderer project. Use spec-<id> for stable links and Spec: <title> for display labels. Keep official JSON Forms examples in their own jsonforms- namespace. New catalog entries appear after rebuilding/updating the spec package; no renderer registration edit is required. Framework-native enhancements are optional and cannot gate discovery.

Demo and Demo and Data tabs SHOULD use one shared validation-summary icon across renderer families, with an error count and the actual errors available on hover and keyboard focus. The icon has an accessible name. Additional errors remain visible alongside schema validation errors, with useful paths and source labels where available. A count alone is insufficient to explain an invalid form.

Example source navigation

When a demo hosts both spec fixtures and original JSON Forms examples, provide an Example source selector above sidebar search: Spec examples, JSON Forms originals, and All examples. Prefer Spec initially when present; otherwise use All. All also includes host-specific additions. Search combines with this filter rather than replacing it. Identify sources from registration metadata, not arbitrary display-label matching.

Filtering changes the navigation list only. Preserve the currently open form and its edits, and allow direct example URLs even if their source is excluded from the menu. Show an empty-results state when search and source have no matches. Use the host UI library's accessible select or equivalent navigation control. The source choice may remain session-local; it is not form config.

Layout default conformance

All ports must follow the portable defaults in §7.1. Native field margins must not add to the managed layout gap. Each renderer project records verification against this contract.