json-to-html.js
v1.0.4
Published
An application that parses json to a html structure.
Downloads
2
Maintainers
Readme
Installation
npm install json-to-html.js --saveBasic usage:
import JsonToHtmlBuilder from 'json-to-html.js'
...
const jsonToHtml = new JsonToHtmlBuilder(Data, HTMLElement).build()
jsonToHtml.execute()Concepts
{
"id": "61f99f57cfb6f9db49bfedde",
"email": "[email protected]",
"roles": ["owner", "guest"]
}{ "id": "61f99f57cfb6f9db49bfedde", "email": "[email protected]", "roles" : [ "owner", "guest" ] }
Container
CSS classes:
- base: base-container
- when-array: array
- when-object: object
- Its construction can be overridden by withCreateContainerEl on building phase
Section
CSS classes:
- base: section-container
- when-array: array
- when-object: object
- Its construction can be overridden by withCreateSectionEl on building phase
Section header
CSS classes:
- base: section-header
- Its construction can be overridden by withCreateSectionHeaderEl on building phase
Field
CSS classes:
- base: field-container
- key element: key
- value element: value
- Its construction can be overridden by withCreateFieldEl on building phase
Value
CSS classes:
- base: value
- Its construction can be overridden by withCreateValueEl on building phase
Advanced usage:
coming soon...
