0.2.2 • Published 5 years ago
@shubich/react-table v0.2.2
@shubich/react-table
React component for rendering lists to html table
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
License
@shubich/react-table is MIT licensed.