0.0.1 • Published 2 years ago

@ognimelo/hrnet-datatable v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

OpenClassrooms React Developer Course - Project 14 - DataTable Component

DataTable Component

Library made for the HRnet application.

Installation

npm i @ognimelo/hrnet-datatable

Usage

Example

import DataTable from '@ognimelo/hrnet-datatable'

const columns = [
	{ title: 'First Name', data: 'firstName' },
	{ title: 'Last Name', data: 'lastName' },
	{ title: 'Date of Birth', data: 'dateOfBirth' },
	{ title: 'City', data: 'city' },
]

const data = [
	{
		firstName: 'Bob',
		lastName: 'Unicorn',
		dateOfBirth: '11/05/1995',
		city: 'Paris',
	}
]

export default () => {
	return (
		<div id='employee-div' className='container'>
			<h1>Data Table</h1>
			<DataTable columns={columns} data={data} />
		</div>
	)
}

Component props

data

Data to display in the table. Type: Array<{ [key: string]: string }>

columns

Columns name and key value to display. Type: Array<{ title: string; data: string }>

0.0.1

2 years ago

0.0.0

2 years ago