5.0.1 • Published 8 months ago

@licuido-ui/ui_json-editor v5.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

JsonEditor

The JsonEditor component is a customizable JsonEditor element designed to display text or a React element with a colored background. It provides options to set the text color, background color, and a click event handler for interactivity.

Author

Link

Story Book Link ButtonGroup

PlayGround

Try it have a fun codeBox

Installation

npm i @licuido-ui/ui_json-editor

Import component

import { JsonEditor } from '@licuido-ui/ui_json-editor';

Usage

<JSONInput locale={localeEn} {...rest} />

Image

alt text

Sample code

<JSONInput locale={localeEn} {...rest} />
PropTypeDescriptionDefault
dataanyThe JSON data to be displayed in the editor.See example array of objects
onChangeJSON(data: object) => voidCallback function triggered when the JSON data is changed.() => false
jsonHeightStylestringCSS height style for the JSON editor container.'50vh'
labelFontSizestringFont size for JSON property labels.'14px'
labelColorstringText color for JSON property labels.'grey'
valueFontSizestringFont size for JSON property values.'14px'
valueColorstringText color for JSON property values.'green'
booleanColorstringText color for boolean values.'red'
numberColorstringText color for numeric values.'green'
rootBorderColorstringBorder color for the JSON editor container.'#D9DBDD'
rootBorderstringBorder style for the JSON editor container.'1px solid'
rootBorderRadiusstringBorder radius for the JSON editor container.'8px'
sideBarBackgroundColorstringBackground color for the sidebar in the JSON editor.'#F0F3F6'
editorBackgroundstringBackground color for the JSON editor.'transparent !important'

Default Props:

JsonEditors.defaultProps = {
  data: [
    {
      name: 'John Doe',
      age: 25,
      city: 'Example City',
      isStudent: true,
    },
    {
      name: 'John',
      age: 53,
      city: 'Example City',
      isStudent: true,
    },
  ],
  onChangeJSON: () => false,
  jsonHeightStyle: '50vh',
  labelFontSize: '14px',
  valueFontSize: '14px',
  labelColor: 'grey',
  valueColor: 'green',
  booleanColor: 'red',
  numberColor: 'green',
  rootBorder: '1px solid',
  rootBorderColor: '#D9DBDD',
  rootBorderRadius: '8px',
  sideBarBackgroundColor: '#F0F3F6',
  editorBackground: 'transparent !important',
};


*Note: Default props are subject to change based on the implementation of the component.*