@berlitz/table

2.6.0 • Public • Published

Table npm version

A themed wrapper around React Table https://github.com/tannerlinsley/react-table

When to use this component

When you need a table which is driven by structured data

Installation

yarn add @berlitz/table

Props

See docs for react-table for data and column structures

Prop Type Required Default Description
paginated boolean should this table be paginated
rowsPerPage number 16 number of rows per page, if paginated

Usage

import Table from '@berlitz/table'
const MyApp = () => (
  <Table
    columns={[
      {
        Header: 'First Name',
        accessor: 'firstName',
      },
      {
        Header: 'Last Name',
        accessor: 'lastName',
      },
      {
        Header: 'Email',
        accessor: 'email',
      },
      {
        Header: 'Order ID',
        accessor: 'orderId',
      },
    ]}
    data={[...Array(10).keys()].map(() => ({
      firstName: faker.name.firstName(),
      lastName: faker.name.lastName(),
      email: faker.internet.email(),
      orderId: faker.random.uuid(),
    }))}
  />
)

Readme

Keywords

none

Package Sidebar

Install

npm i @berlitz/table

Weekly Downloads

1,084

Version

2.6.0

License

MIT

Unpacked Size

25.9 kB

Total Files

6

Last publish

Collaborators

  • berlitz