0.1.3 • Published 3 years ago

@jpotin/data-table-react v0.1.3

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

data-table-react

DataTable preview.png

A react component that display data in a table with features. Pagination, search, sorting.

Prerequisites

Installation

npm install @jpotin/data-table-react

Once installed, import the "DataTable" component

import DataTable from "@jpotin/data-table-react"

You can import the css

import "@jpotin/data-table-react/dist/style.css"

Usage

The component takes a unique prop data

<DataTable prop={value} />

The value is an object, or a function that return an object in the shape of:

{
  labels: [
    { title: 'First Name', data: 'firstName' },
    { title: 'Last Name', data: 'lastName' },
  ],
  entries: [
  {
    firstName: 'Basia',
    lastName: 'Osborn',
  },
  {
    firstName: 'Galena',
    lastName: 'Frost',
  }]
  ,
  sortBy: 'firstName',
  sortDirection: 'asc',
  }

sortBy and sortDirection properties are optionals sortDirection can be 'asc' or 'desc'

Typescript

This package contains built-in TypeScript declarations.

sortDirection need to be set as 'asc' | 'desc'

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago

0.1.0

3 years ago