JSONSchemaEditor.Viewer (json_schema_editor v0.9.9)

View Source

A component for displaying JSON with syntax highlighting.

It supports structural punctuation highlighting and indentation guides.

Examples

Passing a map

<JSONSchemaEditor.Viewer.render json={%{"a" => 1, "b" => [true, nil]}} />

Passing a JSON string

<JSONSchemaEditor.Viewer.render json="{\"foo\": \"bar\"}" />

Summary

Functions

render(assigns)

Attributes

  • json (:any) (required) - The JSON data to display (map, list, or already encoded string).
  • class (:string) - Additional CSS classes for the container. Defaults to nil.
  • Global attributes are accepted. Additional HTML attributes.