@choice-ui/table-core
v0.0.10
Published
Choice UI Table Core - React table component library
Readme
@choice-ui/table-core
A high-performance, extensible React table library built on TanStack Table.
Installation
pnpm add @choice-ui/table-coreFeatures
- Built on TanStack Table core
- Reactive state management (Legend State)
- Drag and drop sorting (dnd-kit)
- Cell selection and range fill
- Column pinning
- Row grouping and expansion
- Column resizing
- Undo/Redo support
- Virtual scrolling optimization
Basic Usage
import { TableCore, TableProvider } from "@choice-ui/table-core";
const columns = [
{ accessorKey: "name", header: "Name" },
{ accessorKey: "email", header: "Email" },
];
const data = [
{ name: "John", email: "[email protected]" },
{ name: "Jane", email: "[email protected]" },
];
function App() {
return (
<TableCore
data={data}
columns={columns}
width={800}
height={400}
/>
);
}Exports
Components
TableCore- Main table componentTableProvider- Table context providerTablePane- Table paneTableScroll- Scroll containerTableHeader- Table headerTableBody- Table bodyTableRow- Table rowTableCell- Table cellTableFooter- Table footerFillHandle- Fill handle for cell range operations
Hooks
useTable- Get table instanceuseReactTable- Create table instanceuseCell- Cell stateuseHeader- Header stateuseCellEditing- Cell editinguseUpdateCell- Update cell valueuseRenderCell- Render cell contentusePosition- Position calculationuseCellHover- Cell hover stateuseRowHover- Row hover stateuseColumnHover- Column hover state
Features
PropsFeature- Props extensiondndFeature- Drag and drop functionalityagentFeature- Agent functionality
Types
import type {
RowData,
ColumnDef,
Row,
Column,
Header,
Cell,
TableOptions,
PaginationState,
TableState,
TableServerState,
TableCoreProps,
TableInstance,
} from "@choice-ui/table-core";License
MIT
