@litable/react
v1.0.0
Published
React wrapper for LiTable — lightweight, dependency-free table plugin
Downloads
70
Maintainers
Readme
@litable/react
React wrapper for LiTable.
Install
npm install @litable/react @litable/coreUsage
import { LiTableComponent } from '@litable/react';
function App() {
return (
<LiTableComponent
data={rows}
columns={[
{ field: 'name', title: 'Name', sortable: true },
{ field: 'email', title: 'Email' },
]}
pagination={{ enabled: true, pageSize: 25 }}
sorting
filtering
/>
);
}Props
All LiTableOptions fields are accepted as props. Additionally:
| Prop | Type | Description |
|---|---|---|
| className | string | CSS class on the container <div> |
| style | CSSProperties | Inline styles on the container <div> |
Lifecycle
The component initializes once on mount and calls .update() on every render with the current props. It destroys the instance when unmounted.
TypeScript
import type { LiTableOptions, ColumnDef } from '@litable/react';