abakus
v0.0.1-2
Published
Abakus is table component for projects based on tailwindcss and react
Downloads
11
Readme
abakus https://abakus.raqz.pl/
Install
npm install --save abakus
Usage
import React, { Component } from 'react'
import { Table } from 'abakus'
const UsersTable = ({ users }) => {
const columns: Column<IData>[] = [
{
field: "id",
title: 'No',
width: 50,
},
{
title: 'Name',
field: "name"
},
{
title: 'Surname',
field: "surname",
},
{
field: "",
title: "Actions",
width: 150,
classNames: {
header: 'text-right pr-4',
root: 'text-right pr-4'
},
// Delete user button
renderCol: (_, row) => <button onClick={() => remove(row)} className='text-sm border border-black border-opacity-50 bg-black bg-opacity-20 hover:bg-opacity-30 py-1 px-2 rounded-md'>Delete</button>
}
];
return (
<Table
data={users}
columns={columns} />
);
}
License
MIT © kolezka