0.0.13 • Published 10 months ago
react-table-mc v0.0.13
React table
A simple, customizable and easy to use table build with React
Features
- Display has much column and rows as you want
- Sort data
- Pagination
- Search bar
- Select page length
Installation
To install, you can use npm or yarn:
$ npm install react-table-mc
$ yarn add react-table-mc
The package is built with Node v16.15.1 and NPM v8.4.1
Usage
The component needs two props:
Props | Types | Required | Default | Description |
---|---|---|---|---|
intialData | Array | ✅ | An array of object, each object will be a row and its values will be columns | |
columns | Array [] | ✅ | An array of object corresponding with the value in initial data |
import { Table } from "react-table-mc"
import "react-table-mc/dist/style.css"
function App() {
return (
<div className="App">
<Table initialData={data} columns={[
{ title: "First Name", data: "firstName" },
{ title: "Last Name", data: "lastName" },
{ title: "Start Date", data: "startDate" },
{ title: "Department", data: "department" },
{ title: "Date of Birth", data: "dateOfBirth" },
{ title: "Street", data: "street" },
{ title: "City", data: "city" },
{ title: "State", data: "state" },
{ title: "Zip Code", data: "zipCode" }
]} />
</div>
)
}
export default App