This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

react-tb
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

react-tb

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save react-tb

Usage Example

import { ReactTb } from 'react-tb'

class Example extends Component {
  render() {
    return <ReactTb
        columns={columns}
        data={data}
        noDataLabel='no data found!'
        isDraggable={true}
        onDragEnd={() => {}}
        columnKey={'id'}
      />
  }
}

Using Columns

columns are the array that defines the table columns to show the data like (firstname, lastname, ...etc).

columns example

const columns = [
  {
    name: "firstname", // column name will show in the header (accept html also)
    isHidden: false, // you can also hide or show the column by setting isHidden value
    body: (item) => {
      // you can use data with the specific column like item.whatever
      return <td></td> // you should always return jsx decorated by td tag
    }
  }
]

Table Props (required)

prop name description
column the table columns to define table
data the table data (could come from the database)
columnKey the unique key to identify each row
noDataLabel label to show when no data
isDraggable make the table's row draggable
onDragEnd callback function will be fired when drag is end ( will give you the new order)

License

MIT © AlsiddigAhmed

Readme

Keywords

none

Package Sidebar

Install

npm i react-tb

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

288 kB

Total Files

11

Last publish

Collaborators

  • alsiddigahmed