1.1.0 • Published 3 years ago

react-table-modern v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-table-modern

A Modern Table Made using React 🔥

NPM JavaScript Style Guide

Install

npm install --save react-table-modern

Usage

import React, { Component } from 'react'

import ReactTableModern from 'react-table-modern'

const data = [
  {
    name: 'Abdul Ghani',
    address: { city: 'Hyd', street: 'stret', country: 'India' },
    phone: '9191919191',
    email: 'hello@abdulghani.tech',
    website: 'abdulghani.tech'
  },
  {
    name: 'Abdul Ghani 2',
    address: { city: 'Bng', street: '1et', country: 'USA' },
    phone: '9191975571',
    email: 'hi@abdulghani.tech',
    website: 'abdulghani.tech'
  },
  {
    name: 'Abdul Ghani 3',
    address: { city: 'Bng', street: '1et', country: 'USA' },
    phone: '9191975571',
    email: 'hi@abdulghani.tech',
    website: 'abdulghani.tech'
  },
  {
    name: 'Abdul Ghani 4',
    address: { city: 'Bng', street: '1et', country: 'USA' },
    phone: '9191975571',
    email: 'hi@abdulghani.tech',
    website: 'abdulghani.tech'
  },
  {
    name: 'Abdul Ghani 5',
    address: { city: 'Bng', street: '1et', country: 'USA' },
    phone: '9191975571',
    email: 'hi@abdulghani.tech',
    website: 'abdulghani.tech'
  },
  {
    name: 'Abdul Ghani 6',
    address: { city: 'Bng', street: '1et', country: 'USA' },
    phone: '9191975571',
    email: 'hi@abdulghani.tech',
    website: 'abdulghani.tech'
  }
]

const columns = [
  {
    dataField: 'name',
    text: 'Name',
  },
  {
    dataField: 'address.country',
    text: 'Address',
  },
  {
    dataField: 'phone',
    text: 'Phone'
  },
  {
    dataField: 'email',
    text: 'Email'
  },
  {
    dataField: 'website',
    text: 'Website'
  }
]

class Example extends Component {
  render() {
    return (
      <ReactTableModern
        data={data}
        columns={columns}     
      />
    )
  }
}

Props

PropTypeDefaultRequired
dataArray Of Objects[]true
columnsArray Of Objects[]true
paginationRequiredbooleantruefalse
paginationItemsPerPagenumber5false
tableWrapperStyleReact.CSSProperties-false
tableStyleReact.CSSProperties-false
tableHeaderStyleReact.CSSProperties-false
tableHeaderCellsStyleReact.CSSProperties-false
tableCellsStyleReact.CSSProperties-false
nextAndPrevBtnStyleReact.CSSProperties-false
PaginationWrapperStyleReact.CSSProperties-false
paginationBtnsReact.CSSProperties-false

License

MIT © abdulghanitech

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago