Skip to content

DavidWeiland/20220407_dw-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shields shields shields

@DAVID_WEILAND/DW-TABLE

Personal React Component

This component must work in react app ans it was bootstrapped with Create React App.

Install notice

In your own react project :

install with npm :

npm install --save @david_weiland/dw-table

or, with yarn :

yarn add dw-table

Here th tlink to @david_weiland/dw-table published on npmjs.

How to use @david_weiland/dw-table component :

  1. First, import Table from "@david_weiland/dw-table"
  2. In the render, add where you want the module
  3. You need precise options : data, model

For example :

export const YourApp = ()=> {
  return (
    <Table
      data={
        [
          {
            "firstName": "Aaaa",
            "lastName": "Bbbb",
            "dateOfBirth": "yyyy-mm-dd",
          },
          {
            "firstName": "Cccc",
            "lastName": "Dddd",
            "dateOfBirth": "yyyy-mm-dd",
          }
        ]
      }
      model={
        [
          { "title": "First Name", "value": "firstName", "type":"string", "flex": 2 },
          { "title": "Last Name", "value": "lastName", "type":"string", "flex": 3 },
          { "title": "Date of Birth", "value": "dateOfBirth", "type":"date", "flex": 2 }
        ]
      }
    />
  )
}

Props

Required props

  • data={}: this is the source of your table (array)
  • model={}: (all of this options are required)
    • title : header entry of the table,
    • value : the link to the data,
    • type : precise the type of value,
    • flex : define width of each categories

Supports

Homepage of the module : https://github.com/DavidWeiland/20220407_dw-table

Please report bugs in : https://github.com/DavidWeiland/20220407_dw-table/issues

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published