@adapttable/antd
v0.2.0
Published
Ant Design adapter for AdaptTable — a batteries-included antd data table with sorting, filtering, URL state, selection, RTL, and dark mode on antd's high-level Table.
Downloads
345
Maintainers
Readme
@adapttable/antd
The Ant Design adapter for AdaptTable —
a batteries-included antd data table with sorting, filtering, URL-synced
state, selection + bulk actions, RTL, and dark mode. It drives antd's
high-level <Table> from the headless @adapttable/core engine, so you get
the antd look-and-feel wired to a shareable, server-or-client data source.
pnpm add @adapttable/antd @adapttable/core antd react react-domQuickstart
import { DataTable, useFrontendData, type ColumnDef } from "@adapttable/antd";
interface Person {
id: string;
name: string;
city: string;
}
const columns: ColumnDef<Person>[] = [
{ key: "name", header: "Name", accessor: (r) => r.name, sortable: true },
{ key: "city", header: "City", accessor: (r) => r.city },
];
export function People({ data }: { data: Person[] }) {
const source = useFrontendData({ data, columns });
return <DataTable source={source} columns={columns} rowKey={(r) => r.id} />;
}Wrap your app in antd's ConfigProvider to control the theme (including
theme.darkAlgorithm) and direction="rtl", as usual. Swap useFrontendData
for useBackendData to drive the table from a server-paginated query — the
component doesn't change.
Features
- Client or server data through one
TableSource. - URL-synced search / sort / filters / page — shareable, deep-linkable.
- Native antd
<Table>header sort carets, rowCheckboxselection (with indeterminate select-all) + bulk actions with confirm. - Filter
Drawer+ removableTagchips. - antd
Pagination(with page-size changer) in paged mode; infinite scroll (IntersectionObserver auto-load + a "Load more" fallback) in infinite mode. - Responsive: a horizontally-scrollable
<Table>on desktop, and an antdCard+Descriptionslayout on mobile (auto by viewport). - antd
Skeletonloading (honouringskeletonRows),Alerterror with retry, and anEmptystate. - Logical (RTL-aware) column alignment, column
width, customCellrenderers, and conditional row actions (isHidden/isDisabled). slots(skeleton, empty),className,size,bordered, injectableconfirm.
License
MIT © Orwa Mahmoud
