01
Overview
Controlled free-form JSON text editing with a native textarea, parse feedback, and accessible field wiring.
Usage
02
When to use
Use when
- Editing arbitrary JSON source while preserving the exact string in parent-owned state.
- A lightweight native editor is preferable to shipping a code-editor runtime.
Avoid when
- Editing a JSON Schema with guided form and diff views. Use Json schema editor instead
- Displaying JSON without allowing changes. Use Json viewer instead
03
Examples
Controlled JSON editor
A controlled JSON text field with optional lazy syntax highlighting and parse feedback.
04
Props
| Name | Type | Default | Required | Bindable | Description |
|---|---|---|---|---|---|
id | text | req | Unique identifier used for the label and feedback relationships. | ||
value | text | req | Controlled JSON source text. | ||
label | text | req | Visible label associated with the native textarea. | ||
description | text | Supporting text announced with the editor. | |||
error | text | External validation error. Takes precedence over JSON parse feedback. | |||
rows | number | 8 | Number of visible text rows. Defaults to 8. | ||
validFeedbackVisible | boolean | true | Whether valid JSON should render an announced success message. Defaults to true. | ||
highlight | boolean | false | Enables a lazy syntax-highlighted view with inline parse-error annotation. Defaults to false. | ||
onValueChange | (value: string) => void | Called with the proposed JSON source whenever the user edits the textarea. | |||
autofocus | unknown | false | |||
wrap | unknown | req | |||
onscroll | unknown | req |
05
Accessibility
Tab
Moves focus out of the editor without trapping the keyboard.
Uses a native textarea with a programmatic label and announced parse feedback.