react-json-editor-ajrm vs react-json-pretty vs react-json-tree vs react-json-view
React JSON Visualization Libraries
react-json-editor-ajrmreact-json-prettyreact-json-treereact-json-viewSimilar Packages:

React JSON Visualization Libraries

These libraries are designed to help developers visualize and manipulate JSON data in React applications. They provide various functionalities ranging from editing JSON structures to displaying them in a user-friendly format. Each library has its unique features and use cases, making them suitable for different scenarios in web development.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
react-json-editor-ajrm0360350 kB13 years agoMIT
react-json-pretty0160-76 years agoMIT
react-json-tree014,34763.2 kB225a year agoMIT
react-json-view03,661-1915 years agoMIT

Feature Comparison: react-json-editor-ajrm vs react-json-pretty vs react-json-tree vs react-json-view

Editing Capabilities

  • react-json-editor-ajrm:

    react-json-editor-ajrm provides a full-fledged JSON editing experience, allowing users to modify JSON data through a structured interface. It supports validation and error highlighting, making it suitable for applications where user input is necessary.

  • react-json-pretty:

    react-json-pretty does not offer editing capabilities; it is solely focused on displaying JSON data in a formatted manner. It is ideal for scenarios where data is presented but not modified.

  • react-json-tree:

    react-json-tree is primarily a viewer and does not support editing JSON data. It excels in visualizing data hierarchically, making it easier to understand complex JSON structures.

  • react-json-view:

    react-json-view allows for inline editing of JSON data, providing a balance between viewing and editing. Users can modify values directly in the tree structure, making it versatile for applications needing both functionalities.

Visual Representation

  • react-json-editor-ajrm:

    react-json-editor-ajrm presents JSON data in a structured form, resembling a form interface, which may not be as visually appealing as tree or pretty formats but is functional for editing.

  • react-json-pretty:

    react-json-pretty emphasizes aesthetics, providing a colorful and formatted view of JSON data that enhances readability, making it suitable for presentations.

  • react-json-tree:

    react-json-tree offers a collapsible tree structure that visually represents JSON data hierarchically, allowing users to navigate through nested objects easily, which is great for understanding complex data relationships.

  • react-json-view:

    react-json-view combines a clean tree structure with the ability to collapse and expand nodes, providing a clear and interactive way to explore JSON data while allowing for inline edits.

Customization

  • react-json-editor-ajrm:

    react-json-editor-ajrm allows for some customization in terms of validation rules and error messages, but its primary focus is on functionality rather than extensive styling options.

  • react-json-pretty:

    react-json-pretty offers limited customization options, focusing on predefined styles for displaying JSON data, which may not suit all design needs.

  • react-json-tree:

    react-json-tree provides customization options for styling the tree nodes, allowing developers to change colors and fonts, making it adaptable to different application themes.

  • react-json-view:

    react-json-view is highly customizable, allowing developers to modify styles, themes, and even the behavior of the viewer, making it suitable for a wide range of applications.

Performance

  • react-json-editor-ajrm:

    react-json-editor-ajrm is optimized for performance during editing, but complex JSON structures may still impact rendering speed due to the form-like interface.

  • react-json-pretty:

    react-json-pretty is lightweight and performs well with smaller JSON datasets, but may struggle with very large datasets due to its focus on visual formatting.

  • react-json-tree:

    react-json-tree is efficient in rendering hierarchical data and performs well with nested structures, making it suitable for complex JSON visualizations.

  • react-json-view:

    react-json-view balances performance with functionality, handling moderate-sized JSON data efficiently while providing interactive features.

Use Cases

  • react-json-editor-ajrm:

    Best used in applications where users need to input or modify JSON data, such as configuration editors or data entry forms.

  • react-json-pretty:

    Ideal for displaying static JSON data in a visually appealing way, such as API response viewers or documentation.

  • react-json-tree:

    Great for applications that require a clear hierarchical view of JSON data, such as data explorers or debugging tools.

  • react-json-view:

    Suitable for applications needing both viewing and editing capabilities, such as admin panels or settings management.

How to Choose: react-json-editor-ajrm vs react-json-pretty vs react-json-tree vs react-json-view

  • react-json-editor-ajrm:

    Choose react-json-editor-ajrm if you need a robust JSON editor that allows users to edit JSON data directly within a form-like interface, with support for validation and error handling. This package is ideal for applications that require user input and manipulation of JSON data.

  • react-json-pretty:

    Select react-json-pretty for a lightweight solution focused on displaying JSON data in a visually appealing format. It's best suited for applications where you need to present JSON data without the need for editing capabilities, emphasizing readability and aesthetics.

  • react-json-tree:

    Opt for react-json-tree if you want a tree view representation of JSON data. This library is excellent for applications that require a hierarchical view of JSON structures, allowing users to expand and collapse nodes for better navigation and understanding of complex data.

  • react-json-view:

    Use react-json-view when you need a versatile component that supports both viewing and editing of JSON data. It offers features like copying to clipboard, collapsing nodes, and customizable styling, making it suitable for applications that require a comprehensive JSON viewer and editor.

README for react-json-editor-ajrm

Warning:

As you may already know, the react-json-editor-ajrm's orignal project is not actively maintained and that it will eventually be deprecated. So I've decided to set an official date for deprecation. The tentative date for this is June 15, 2023.

What does deprecation mean?

  • It means the Github project will be archived as read only.
  • It means the npm packages will appear deprecated, but it WILL NOT be deleted.
  • It means the new project will be available officially on that date.

I would like to thank those who used it in their projects and those who have contributed in some way to the project. I simply no longer wish to maintain this project. It was made in the early days of my software engineer career, and it has not caught up to today's standards nor mine.

But don't fret. I intend to breathe new life into this project rewriting it from the ground up.

I would like to take the learnings of the past, and avoid some of the issues react-json-editor-ajrm currently has. I would also like to highlight the things done well, and I wish to carry on.

I've setup home for this new project here enio. I've also set up a discussion here if you have any questions or comments.


react-json-editor-ajrm

npm Build Status npm Known Vulnerabilities All Contributors



A stylish, editor-like, modular, react component for viewing, editing, and debugging javascript object syntax!

Installing Dependency

  • Using node package manager:
   $ npm i --save react-json-editor-ajrm

How to Use

    import JSONInput from 'react-json-editor-ajrm';
    import locale    from 'react-json-editor-ajrm/locale/en';

    <JSONInput
        id          = 'a_unique_id'
        placeholder = { sampleObject }
        colors      = { darktheme }
        locale      = { locale }
        height      = '550px'
    />

Hint: There are two different root paths: react-json-editor-ajrm and react-json-editor-ajrm/es. The first contains polyfilled ES5 code, the second unpolyfilled ES6. The react-json-editor-ajrm/es version is not compatible with create-react-app. If you are unsure of which one you need/want, pick the first - it has the best compatibility with tools and browsers.

Examples

The ./examples folder contains two examples:

  1. webpack-project - A basic example without much overload
  2. create-react-app-project - A small example using the create-react-app template

Testing right away!

  1. Fork and/or clone this Github repository
  2. Go to an example project under react-json-editor-ajrm/example:
    $ cd path/to/repo/react-json-editor-ajrm/example/webpack-project
  1. Install example project dependencies:
    $ npm i
  1. Serve sample website to port 8080:
   $ npm start
  1. Open http://localhost:8080 in the web browser

Latest Spotlight Release Notes [v2.5.12] - October 15, 2020

  1. Fixed import issue.

Upcoming Features

  1. Bug fixes.

Features

  1. Write as if you are in a text editor.
  2. Checks for syntax mistakes and provides feedback; Custom errors can also be overlaid on the editor.
  3. You can customize color palette as you please.
  4. Accepts a javascript object in placeholder property to display after component mounts.
  5. For any valid textContent, calculates and makes available in this.state as plain text, markup text, and javascript object.
  6. Locale support for English, German, Spanish, Chinese, French, Indonesian, Russian, Hindi, Japanese and Tamil.

Component Properties

NameDescriptionTypeRequired
localeThe locale of your editor. Import locales like this: import locale from 'react-json-editor-ajrm/locale/en'. Learn MoreobjectMandatory
idAn optional id to assign to the actual text input DOM node. Asides the from the text input, the following nodes will also receive an id: {id}-outer-box, {id}-container, {id}-warning-box, {id}-labelsstringOptional
placeholderSend a valid javascript object to be shown once the component is mounted. Assign a different value to have the component's initial content re-rendered.objectOptional
resetSend true to have component always re-render or 'reset' to the value provided on the placeholder property.booleanOptional
viewOnlySend true if you would like for content shown not to be editable.booleanOptional
onChangeWhenever onKeyPress event take place, it will return content values.objectOptional
onBlurWhenever onBlur event take place, it will return content values.objectOptional
confirmGoodSend false if you would like for the checkmark to confirm good syntax to be hidden.booleanOptional
heightA shorthand property to set a specific height for the entire component.stringOptional
widthA shorthand property to set a specific width for the entire component.stringOptional
onKeyPressUpdateSend false if you would like for component not to automatically update on key press.booleanOptional
waitAfterKeyPressAmount of milliseconds to wait before re-rendering content after keypress. Value defaults to 1000 when not specified. In other words, component will update if there is no additional keystroke after the last one within 1 second. Less than 100 milliseconds does not makes a difference.numberOptional
modifyErrorTextA custom function to modify the component's original warning text. This function will receive a single parameter of type string and must equally return a string.functionOptional
errorContains the following properties:objectOptional
error.reasonA string containing a custom error messsagestringOptional
error.lineA number indicating the line number related to the custom error messagenumberOptional
themeSpecify which built-in theme to use.stringOptional
colorsContains the following properties:objectOptional
colors.defaultHex color code for any symbols, like curly braces, and comma.stringOptional
colors.stringHex color code for tokens identified as string values.stringOptional
colors.numberHex color code for tokens identified as integeter, double, or float values.stringOptional
colors.colonHex color code for tokens identified as colon.stringOptional
colors.keysHex color code for tokens identified as keys or property names.stringOptional
colors.keys_whiteSpaceHex color code for tokens identified as keys wrapped in quotes.stringOptional
colors.primitiveHex color code for tokens identified as boolean values and null.stringOptional
colors.errorHex color code for tokens marked with an error tag.stringOptional
colors.backgroundHex color code for component's background.stringOptional
colors.background_warningHex color code for warning message displaying at the top in component.stringOptional
styleContains the following properties:objectOptional
style.outerBoxProperty to modify the default style of the outside container div of component.objectOptional
style.containerProperty to modify the default style of the container of component.objectOptional
style.warningBoxProperty to modify the default style of the container div of the warning message.objectOptional
style.errorMessageProperty to modify the default style of the warning message.objectOptional
style.bodyProperty to modify the default style of the container div of row labels and code.objectOptional
style.labelColumnProperty to modify the default style of the container div of row labels.objectOptional
style.labelsProperty to modify the default style of each row label.objectOptional
style.contentBoxProperty to modify the default style of the container div of the code.objectOptional

Component Sections

    outerBox
    +-- container
        +--- warningBox
             +---- errorMessage
        +--- body
             +---- labelColumn
                   +----- labels
             +---- contentBox
                   +----- auto generated markup

Content Values

Whenever RJEA re-renders its content, any function passed onto onChange property will receive a single object parameter with the following keys and values:

KeyDescription
plainTextA string representation of then content which includes linebreaks and indentation. Great to console.log()
markupTextA string representation of the auto-generated markup used to render content.
jsonA JSON.stringify version of content.
jsObjectA javascript object version of content. Will return undefined if the content's syntax is incorrect.
linesNumber of lines rendered for content to be displayed.
errorReturns false unless the content's syntax is incorrect, in which case returns an object with a token and a line number which corresponds to the location at which error occurred and a reason

Built-In Themes

RJEA supports built-in theme. Here is the list.

Built With

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Contributors

Thanks goes to these wonderful people :smile::


Andrew Redican

📢 💻 🌍 ⚠️

Patrick Sachs

💻 🌍 ⚠️

Allan Kehl

🌍

esbenvb

📖

Markus Petrykowski

💡

Rick Brunstedt

💻

ADirtyCat

🌍

Cédric

🌍

Radit

🌍

asketes

🌍

C.G.Vedant

🤔

Shehbaz Jafri

🌍

Vasantha Kumar R B

🌍

Aditya Periwal

🌍

Alexey Lyakhov

💻

Terence Huynh

💻

Richard Hull

💻

tonynguyenit18

💻

This project follows the all-contributors specification. Contributions of any kind welcome!