0.2.0 • Published 5 years ago

@cypherlab/react-table v0.2.0

Weekly downloads
6
License
ISC
Repository
github
Last release
5 years ago

@cypherlab/react-table

Advanced Table

Install

npm i @cypherlab/react-table

Usage

See Live demo
See Code example

import Table from '@cypherlab/react-table'

// create some transform utility
const transformToFlag = (v, item) => (<img src={`/img/flags/${v}.png`} />)

const props = {
  data: [
      { name: 'bruce wayne', lang: 'en' }
    , { name: 'victor hugo', lang: 'fr' }
  ]

  cols: [
      { key: 'name', class: 'text-center w-25' }
    , { key: 'country', path: 'lang', transform: transformToFlag }
  ]
}

// render
<Table {...props} />

Table options

optioninfo
datatable data. [{ foo: "bar" }, { foo: "bar" }]. required
colstable columns.[{}, {}, ...]. required
titletable title
filterquery filter
searchKeyscomma separated. ex: foo,name.first. default: key
onFilter
onClick
hideHeadhide table thead. default: false
hideNoQueryshow empty table if no filter. default: false
heighttable height. default: 400px
colortable head color. default: #3592d6

Cols options

optioninfo
keykey in which to pull value
nameoptional column name. default to key value
classex: text-center w-25
transform(v, item) => [v, itemv].join(',')

Test

You can play with the component in the browser via the index.html.

(yarn|npm) run dev
0.2.0

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago