Skip to content

chunyu717/react-json-to-table

 
 

Repository files navigation

publish

Change package.json

"name": "react-json-to-table-tl",
"version": "0.1.6",

then

$ npm login 
$ npm publish 

react-json-to-table

React library to convert JSON to HTML

Installation

npm install react-json-to-table

Usage

https://codesandbox.io/s/jn3z0mmw2v


import { JsonToTable } from "react-json-to-table";

function App() {
  // ===================== //
  // JSON Object
  // ===================== //
  const myJson = {
    "Student": { name: "Jack", email: "jack@xyz.com" },
    "Student id": 888,
    "Sponsors": [
      { name: "john", email: "john@@xyz.com" },
      { name: "jane", email: "jane@@xyz.com" }
    ]
  };

  return (
    <div className="App">
      {/* ===================== */}
      {/* HOW TO USE IT         */}
      {/* ===================== */}
      <JsonToTable json={myJson} />
      {/* ===================== */}
    </div>
  );
}

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

About

react-json-to-table

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 83.0%
  • HTML 10.3%
  • SCSS 3.4%
  • CSS 3.3%