Svelte Jsoneditor screenshot

Svelte Jsoneditor

Author Avatar Theme by Josdejong
Updated: 23 May 2025
1051 Stars

A web-based tool to view, edit, format, repair, query, transform, and validate JSON

Categories

Overview:

Svelte-JSONEditor is a web-based tool that allows users to view, edit, format, transform, and validate JSON. It comes with various features such as support for different viewing modes, JSON schema validation, color highlighting, undo/redo functionality, and utilities like a color picker and timestamp tag. The library is written with Svelte but can be used in plain JavaScript and other frameworks like SolidJS, React, Vue, Angular, etc.

Features:

  • View and edit JSON: Users can easily view and edit JSON documents using Svelte-JSONEditor.
  • Multiple viewing modes: The tool provides a low-level text editor, a high-level tree view, and a table view for convenient visualization of JSON data.
  • Format (beautify) and compact JSON: Users can format JSON to improve readability or compact it to reduce size.
  • Sort, query, filter, and transform JSON: Users have the ability to perform various operations on JSON data like sorting, querying, filtering, and transforming.
  • Repair JSON: The tool includes functionality to repair or fix JSON documents with syntax errors.
  • JSON schema validation and custom validation: Svelte-JSONEditor supports JSON schema validation and allows users to add their own custom validation rules.
  • Color highlighting, undo/redo, search and replace: Users can highlight specific elements in the JSON document, undo/redo changes, and perform search and replace operations.
  • Utilities: Svelte-JSONEditor also includes helpful utilities like a color picker and timestamp tag for easier JSON manipulation.
  • Handles large JSON documents: The tool has the ability to handle JSON documents up to a size of 512 MB.

Installation:

To use Svelte-JSONEditor in a Svelte project, follow these steps:

  1. Install the library using npm: npm install svelte-jsoneditor
  2. Import the JSONEditor component: import { JSONEditor } from 'svelte-jsoneditor'
  3. Create a JSONEditor component with two-way binding: <JSONEditor bind:json={yourJSONData} />
  • For one-way binding, you can use: <JSONEditor json={yourJSONData} />

To use Svelte-JSONEditor in vanilla JavaScript or other frameworks like SolidJS, React, Vue, Angular, etc., follow these steps:

  1. Install the library using npm: npm install vanilla-jsoneditor
  2. Import the vanilla JSONEditor: import { JSONEditor } from 'vanilla-jsoneditor'
    • Note: In frameworks like React, Vue, or Angular, you’ll need to write some wrapper code around the class interface.
  3. Use the JSONEditor in your code.

For browser usage or when using the standalone ES bundle, use the provided script tag: <script type="module" src="path-to-bundle.js"></script>

Summary:

Svelte-JSONEditor is a powerful web-based tool that provides users with the ability to view, edit, format, transform, and validate JSON. It offers a range of features such as different viewing modes, JSON schema validation, color highlighting, and various utilities. The library can be used in Svelte projects, vanilla JavaScript applications, and other frameworks. It is a versatile tool that simplifies JSON manipulation and enhances the JSON editing experience.