An unstyled react table component built on top of @tanstack/react-table v8
npm install --save unstyled-table
#or
yarn add unstyled-table
#or
pnpm add unstyled-table
//react component
import { useState } from 'react';
import { Table } from 'unstyled-table';
const columns = [
{ accessorKey: 'name', header: 'Name' },
{ accessorKey: 'email', header: 'Email' },
];
export default function YourTable() {
const [data, setData] = useState([
{ name: 'Touha', email: '[email protected]' },
{ name: 'Sadman', email: '[email protected]' },
{ name: 'Otaku Dev', email: '[email protected]' },
]);
return <Table columns={columns} data={data} />;
}
import { useState } from 'react';
import { Table } from 'unstyled-table';
const columns = [
{ accessorKey: 'name', header: 'Name' },
{ accessorKey: 'email', header: 'Email' },
];
export default function YourTable() {
const [data, setData] = useState([
{ name: 'Touha', email: '[email protected]' },
{ name: 'Sadman', email: '[email protected]' },
{ name: 'Otaku Dev', email: '[email protected]' },
]);
return (
<Table
columns={columns}
data={data}
renders={{
table: ({ children }) => (
<div className="table-wrapper">
<table className="table-class">{children}</table>
</div>
),
}}
/>
);
}