Skip to content

📜 Building dynamic tables with React.js, inspired by console.table

License

Notifications You must be signed in to change notification settings

shubich/react-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@shubich/react-table

React component for rendering lists to html table

NPM registry

Install

# NPM
npm install @shubich/react-table

Usage

Input

import * as React from "react";
import { render } from "react-dom";
import ReactTable from "@shubich/react-table";

const cars = [
  {
    mark: "BMW",
    model: "i8",
  },
  {
    mark: "Porsche",
    model: "911",
  },
  {
    mark: "Tesla",
    model: "Model S",
    "0-60 mph": "2.4s"
  }
];

function App() {
  return (
    <ReactTable
      data={cars}
      showIndex={true}
      indexName="id"
    />
  );
}

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

Output

id mark model 0-60 mph
0 BMW i8
1 Porsche 911
2 Tesla Model S 2.4s

Examples

CodeSandbox

License

@shubich/react-table is MIT licensed.

About

📜 Building dynamic tables with React.js, inspired by console.table

Resources

License

Stars

Watchers

Forks

Packages

No packages published