You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 27, 2023. It is now read-only.
I have searched the issues of this repository and believe that this is not a duplicate.
Summary π‘
The Table component lets the user to visualize data in an easy way.
In a responsive way
And support actions and pagination.
The table will be used like this:
import{Table}from'@platzily-ui/components'constrows=[{name: 'Bruce',job: 'Batman'},{name: 'Clark',job: 'Superman'},{name: 'Alonso',job: 'Firefighter'}]constcolumns=[{title: 'Name'// The title shown in the head of the column,accessor: 'name'// the key to access the object in the data},{title: 'Job'// The title shown in the head of the column,accessor: 'job'// the key to access the object in the data},{title: 'Actions',Cell: ({ row, column })=>(// You could pass a key called `Cell` to, it needs to be a function returning a component, and receive as prop, row and column<div><button>Action 1</button><button>Action 2</button></div>)}]constMyComponent=()=>{return(<Tablerows={rows}columns={columns}page={0}// actual pageonPageChange={()=>{}}// function to be called when page change/>)}
The component receive as props
rows (array of any schema) - required
columns (array of the following schema) - required
title: title of the column - required
accessor: key of the row object to be accessed - required if Cell is not presented
Cell: function that receives row and column as prop and returns a component - requried if accessor is not presented
size (qty of rows per page) - required
page (actual page) - required
onPageChange (function to be called when page change) - required
Checklist β
Summary π‘
The Table component lets the user to visualize data in an easy way.
In a responsive way
And support actions and pagination.
The table will be used like this:
The component receive as props
Requirements π
The component mus be tested using unit testing
Motivation π¦
A way to present data to the user.