0.0.1-2 • Published 3 years ago

abakus v0.0.1-2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

0.0.1-2

3 years ago

0.0.1

3 years ago

0.0.1-1

3 years ago

2.0.0

3 years ago