/mantine:mantine-data-gridfrom mantine
Build data tables with @mantine/data-grid (DataGrid on TanStack Table v9). Use for admin lists, orders tables, or any table with sorting, filtering, pagination, row selection, inline editing, grouped rows, tree data, pinned/resizable columns, virtualization, toolbar, export, or custom footer.
Ships in mantine. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Written for Mantine 10.x. @mantine/data-grid is built on TanStack Table v9 (not v8): see
Coming from TanStack Table v8.
DataGrid renders the table, utility columns (selection, expand, row numbers, drag handle),
toolbar, footer and loading/empty states. useDataGrid creates the store: it owns the TanStack
table (store.table), turns features on from the options you pass and exposes state getters. Filter
inputs, bulk actions and row actions are your own Mantine components wired to the store.
Install @mantine/data-grid with its peers @tanstack/react-table, @tanstack/react-virtual and
@tanstack/match-sorter-utils, and import @mantine/data-grid/styles.css after @mantine/core/styles.css.
| Need | Use |
|---|---|
| Static, read-only rows that fit on one screen, no interaction | Table from @mantine/core (Table.ScrollContainer for width) |
| Any of: sort, filter, search, paginate, select, edit, resize/pin/hide columns, group, tree, export, 1000+ rows | DataGrid |
| Rows that are really cards (avatars, multi-line content, actions) on every screen | A list of Card/Paper components; DataGrid with listView only when the same data also needs a table |
<DataGrid data={data} columns={columns} /> works without a store, but only with defaults. Every
feature (pagination, selection, editing, size, controlled state) is an option of useDataGrid, so
create the store as soon as you need one.
interface Order {
id: string;
customer: string;
status: 'paid' | 'pending' | 'refunded';
total: number;
createdAt: string;
}
const columns: DataGridColumnDef<Order>[] = [
{ accessorKey: 'customer', header: 'Customer', enableSorting: true, size: 220 },
{
accessorKey: 'status',
header: 'Status',
filterFn: 'equals',
cell: ({ getValue }) => <StatusBadge status={getValue<Order['status']>()} />,
},
{
accessorKey: 'total',
header: 'Total',
enableSorting: true,
meta: { align: 'end' },
cell: ({ getValue }) => currency.format(getValue<number>()),
},
{ accessorKey: 'createdAt', header: 'Created', enableSorting: true, sortFn: 'datetime' },
];
accessorKey with dot paths, or accessorFn + id) can be sorted, filtered, grouped and edited; display columns (id only) hold buttons; group columns (columns: [...]) build multi-level headers.meta holds the grid settings: label (used by visibility menu, list view, export, group rows; set it when header is not a string), align: 'end' for numbers (adds tabular figures), type: 'actions', disableEditing, disableExport, disableColumnMenu, validate, editComponent, aggregationLabel, formatAggregatedValue.size, minSize, maxSize are pixels (defaults 150 / 20 / unlimited). Defaults for all columns: tableOptions: { defaultColumn: { size: 180 } }.DataGridColumnDef<T>[] or build them with createDataGridColumnHelper<T>(). Untyped arrays defined outside useDataGrid widen accessorKey to string and fail to type-check.function OrdersTable({ orders }: { orders: Order[] }) {
const store = useDataGrid({
data: orders,
columns,
getRowId: (row) => row.id,
withGlobalFilter: true,
withColumnVisibility: true,
pageSize: 25,
});
return (
<DataGrid store={store} highlightOnHover>
<DataGrid.Toolbar />
<DataGrid.Footer />
</DataGrid>
);
}
DataGrid.Toolbar without children renders search (withGlobalFilter), the columns menu
(withColumnVisibility) and the export menu. DataGrid.Footer renders status, page size and pages;
rows are paginated as soon as pageSize is set, so a paginated grid always needs it (or own controls).
Each slice has a <slice> + on<Slice>Change pair on useDataGrid (sorting, columnFilters,
globalFilter, pagination, rowSelection, expanded, grouping, columnVisibility,
columnOrder, columnSizing, columnPinning, rowPinning, cellSelection, editing); passing
either half turns the feature on. Uncontrolled state is read with store.getSorting(),
store.getPagination() and the other getters. State types come from @tanstack/react-table
(SortingState, ColumnFiltersState, PaginationState, RowSelectionState = Record<id, true>).
const [sorting, setSorting] = useState<SortingState>([]);
const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([]);
const [pagination, setPagination] = useState<PaginationState>({ pageIndex: 0, pageSize: 25 });
const [debouncedFilters] = useDebouncedValue(columnFilters, 300);
const query = useOrdersQuery({ sorting, columnFilters: debouncedFilters, pagination });
const resetPage = () => setPagination((current) => ({ ...current, pageIndex: 0 }));
const store = useDataGrid({
data: query.data?.rows ?? EMPTY_ROWS,
columns,
getRowId: (row) => row.id,
manualSorting: true,
sorting,
onSortingChange: (updater) => { setSorting(updater); resetPage(); },
manualFiltering: true,
columnFilters,
onColumnFiltersChange: (updater) => { setColumnFilters(updater); resetPage(); },
manualPagination: true,
pagination,
onPaginationChange: setPagination,
rowCount: query.data?.total ?? 0,
});
<DataGrid store={store} loading={query.isFetching} loadingVariant="bar">
<DataGrid.Toolbar>
<OrderFilters store={store} />
</DataGrid.Toolbar>
<DataGrid.Footer />
</DataGrid>
EMPTY_ROWS is a module-level []. rowCount drives the footer range and page count; pass
pageCount when only the page count is known, or neither for an unknown total (Page 3 with
previous/next).
The grid stores filters but renders no filter inputs: put Mantine inputs in DataGrid.Toolbar (or a
Popover from it) bound to store.getColumnFilterValue(id) / store.setColumnFilter(id, value)
('', null, undefined remove it; store.resetColumnFilters() clears all). Filtering turns on for
columns with enableColumnFilter: true or a filterFn. withFaceting: true adds
store.getFacetedUniqueValues(id) (Select data) and store.getFacetedMinMaxValues(id)
(RangeSlider bounds).
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
const store = useDataGrid({
data,
columns,
getRowId: (row) => row.id,
rowSelection,
onRowSelectionChange: setRowSelection,
pageSize: 25,
});
<DataGrid store={store}>
<DataGrid.Toolbar />
<DataGrid.SelectionBar>
<Button size={store.getControlSize()} variant="default" onClick={archiveSelected}>
Archive
</Button>
</DataGrid.SelectionBar>
<DataGrid.Footer />
</DataGrid>
archiveSelected sends Object.keys(rowSelection) to the API, then calls setRowSelection({}).
DataGrid.SelectionBar replaces the toolbar while rows are selected (floating keeps the toolbar and
floats the bar over the rows). Selected row objects: store.table.getSelectedRowModel().rows.
enableMultiRowSelection: false gives radio selection, enableRowSelection: (row) => boolean
disables some rows, selectOnRowClick on DataGrid selects by clicking the row.
A display column with meta: { type: 'actions' } and cell: ({ row }) => <OrderActions order={row.original} />
is end-aligned, 80px wide, not sortable, filterable, resizable, editable or exported. Use
ActionIcon variant="default" with an aria-label, or a kebab Menu for more than two actions. Row
navigation goes in onRowClick on DataGrid (also fired by Enter on a focused row); clicks on
action buttons bubble to the row, so stop propagation in the actions cell when the row is clickable.
const [data, setData] = useState(initialOrders);
const store = useDataGrid({
data,
columns,
getRowId: (row) => row.id,
editingMode: 'cell',
pageSize: 25,
autoResetPageIndex: false,
onEditSave: async ({ newRow, changedColumnIds }) => {
await api.updateOrder(newRow.id, pick(newRow, changedColumnIds));
setData((current) => current.map((row) => (row.id === newRow.id ? newRow : row)));
},
onEditSaveError: (error) => notifications.show({ color: 'red', message: String(error) }),
});
editingMode: 'cell' edits one cell (double-click, or editTrigger: 'click'; Enter or blur saves,
Escape cancels). editingMode: 'row' edits a whole row, started by double-click or
row.startEditing() from an actions column. A returned promise keeps the editor open until it
settles; a rejection keeps the drafts and calls onEditSaveError. meta.validate blocks invalid
values, meta.editComponent replaces the text input, getCellStatus tints dirty/invalid cells.
<DataGrid
store={store}
loading={query.isFetching}
loadingVariant="bar"
emptyState={({ isFiltered, table }) =>
query.isError ? (
<ErrorState onRetry={query.refetch} />
) : isFiltered ? (
<NoMatches onClear={() => table.resetColumnFilters()} />
) : (
<NoOrders />
)
}
/>
loading with no rows shows skeleton rows; with rows it shows loadingVariant: overlay (default,
blocks interaction), bar (rows stay usable; use for refetch, pagination and infinite scroll) or
skeleton. emptyState is not shown while loading is set. There is no error prop: render the error
through emptyState (data is empty after a failed first load) or above the grid when stale rows stay.
Load mantine-ui together with this skill (and mantine-testing for tests): button variants, text
hierarchy and surfaces come from there.
data keeps its identity between renders. Every new array resets the page index (client-side
pagination), expanded rows and cell selection. Keep it in state, a query cache or useMemo; never
pass rows.filter(...) or query.data?.rows ?? [] inline (use a module-level empty array).useMemo. cell, header and
aggregatedCell functions are rendered as React components, so a columns array rebuilt on every
render remounts every cell (open menus close, inputs lose focus). Values a cell needs from the
component go through row.original, React context, or store getters such as
store.getControlSize(), which are stable.getRowId: (row) => row.id whenever rows have a key. Without it, ids are
array indexes and selection, pinning, expansion and editing point at the wrong rows after sorting,
filtering, deleting or changing the server page.enableSorting: true;
withSorting: true alone makes no column sortable. withRowReorder turns sorting off.filterFn: 'equals' never matches number or boolean cells: convert the value in onChange or use
weakEquals for numbers. A MultiSelect over a scalar column needs filterFn: 'arrHas';
arrIncludesSome only matches cells whose value is an array (tags).manualPagination, the page index is not
reset when sorting or filters change: set pageIndex: 0 in onSortingChange and
onColumnFiltersChange. Debounce text filters before they reach the request, not before
setColumnFilter (the input must stay responsive). withFaceting sees only the current page:
load filter options from the API.data. Write newRow back in onEditSave. The default editor is a text
input and saves strings: give number, date and enum columns an editComponent (NumberInput,
DateInput, Select). With client pagination, set autoResetPageIndex: false so a save does not
jump to page 1; with tree data, tableOptions: { autoResetExpanded: false } so it does not
collapse the tree.size is a useDataGrid option (xs–xl, default sm), not a
DataGrid prop. Buttons and inputs placed in the toolbar, selection bar, footer and cells use
size={store.getControlSize()}.columnPinning is { start: [], end: [] } and rowPinning is
{ top: [], bottom: [] }; left/right are TanStack v8 names. Utility columns are pinned first
by the grid; do not list them. Row pinning needs getRowId.table.getAllLeafColumns() includes the
selection, expand, row number and drag columns: filter out column.columnDef.meta?.utility in
custom visibility menus, exports and settings panels. Use getColumnLabel(column) for labels.height. virtualize="rows" (or "columns", "rows,columns") renders
divs with grid roles, a sticky header, and no row pinning, row reorder or cell spanning.
onScrollToBottom fires on every scroll event near the bottom: ignore it while a page is loading.value={{ onEdit, onDelete }})
re-renders every cell that reads it, including row action menus. Build it with useMemo over
the values it holds.enableRowSelection, getRowCanExpand,
getCellStatus, getRowHeight, labels, classNames and styles are compared by identity:
an inline function or object re-renders every row on every state change. Define them at module
level or in useMemo/useCallback. Event handlers (onRowClick, onEditSave,
renderExpandedRow) can stay inline. More than ~1,000 rows in the DOM make every interaction
slow in the browser itself: paginate or set virtualize="rows"; debounce a text search over
large data with useDebouncedValue before it reaches globalFilter.transformIgnorePatterns: ['/node_modules/(?!@tanstack/)'] to a jest config before the first
grid test (vitest needs nothing). jsdom has no layout, so a virtualized grid renders no rows
there: give HTMLElement an offsetHeight/offsetWidth and getBoundingClientRect size in
the test setup.columnMenuItems adds items to the built-in menu
(sort, pin, hide, group). A custom header with its own menu ends up inside the sort button
(nested buttons): for a different menu, disable sorting on that column or use
meta.disableColumnMenu and put the menu next to the grid.Badge or another component's built-in weight to enforce this rule. For repeated
named statuses in nonnumeric columns, use a small Badge variant="dot" with a meaningful theme
color rather than a filled color badge. Keep the badge surface neutral so color is a mild cue,
not the only way to read the status.3 items, House Espresso +2 more), and
the full list goes into an expandable row (withRowExpansion, getRowCanExpand,
renderExpandedRow, see Detail panel).
Keep the default textOverflow="ellipsis"; 'wrap' is for grids of long text people read, not
for a table of records.DataGrid.SelectionBar floating below the fold, where nobody sees it. For
grids longer than one screen use an ActionBar (fixed to the bottom of the viewport) driven by
the selection; menus and popovers inside it use floatingStrategy="fixed".listView="cards" with renderListItem, or hide
secondary columns with columnVisibility below sm. Columns pushed off-screen into a
horizontal scroll are not a phone layout.sm.cursor: text, a subtle border or background on
td[data-editable]) and a short hint in the toolbar or the empty selection bar ("Double-click a
cell to edit"). Keep double-click editing unless the task explicitly calls for single-click;
switching to editTrigger: 'click' can interfere with selection and inspection.groupedColumnMode: false
instead of removing them by default. Show count and aggregated values in group rows, including
on phones. Reserve groupedColumnMode: 'remove' for grids where the group label truly replaces
those columns.size={store.getControlSize()}: DataGrid.GlobalFilter already
does, so a MultiSelect, DatePickerInput or Button next to it without that size is taller
than the search. A MultiSelect filter sets wrapPills={false} and maxDisplayedValues={1} so
its pills stay on one line.listView="cards" preserves group rows but its built-in group label shows only the count; render
a custom grouped list from store.table.getRowModel().rows if phone group totals are required.
When replacing the grid with a custom phone list, a Columns menu must toggle fields that the
cards actually render; DataGrid.ColumnVisibilityToggle only works inside DataGrid.initialState.sorting the user can change. A sort that is
re-added on every change shows arrows in headers the user never clicked and cannot remove.DataGrid.Footer hides the page buttons while all rows fit
on one page (hideWithOnePage, on by default): do not turn it off or render your own
pagination for a single page.Menu. A sticky header or total row on a short grid must not cover
rows: give the grid a height that leaves the last row visible above the sticky footer.table.getState() → store.table.store.state or the store getters; sortingFn → sortFn;
VisibilityState → ColumnVisibilityState; pinning left/right → start/end; there are no
get*RowModel() options (all row models are registered). Other TanStack options go through
tableOptions. Bound types: DataGridTable<T>, DataGridRow<T>, DataGridColumn<T>,
DataGridCell<T>, DataGridFilterFn<T>, DataGridSortFn<T>.
Read the one that covers your task before building beyond the basic grid above:
references/patterns.md — complete examples: server-side grid with URL state, filter popover with faceted options, operator filters, filter chips, fuzzy search, column visibility/pinning/sizing/reorder with persisted state, column menu, grouping with totals, tree data, row expansion detail panel, row editing with an actions column and custom editors, virtualization and infinite scroll, export, custom toolbar, selection bar and footer, list view on mobile, Styles API and theme defaultsreferences/api.md — every useDataGrid option and store member by feature, DataGrid props, compound components and their props, column meta, editing types and table/row/cell editing APIs, filter and export helpers, labels, CSS variables, Styles API selectorsIf the references do not cover what you need, do not guess:
@mantine/mcp-server) is connected, use search_docs and get_item_dochttps://mantine.dev/llms.txt and open the DataGrid pages (https://mantine.dev/data-grid/getting-started/ and the feature pages next to it). TanStack-level APIs (row.getIsSelected(), column.toggleVisibility()) are documented at https://tanstack.com/table/latest (v9)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
9 skills in this plugin
/mantine-calendarBuild custom calendars and date pickers with @mantine/dates: per-day content and states, your own selection rules, custom periods and display-only calendars. Use this skill when: (1) a calendar shows data per day (prices, free slots, event dots, activity heatmap), (2) days are unavailable with a reason, or a range must not cross booked days, (3) the selection is not a plain date, dates or range (stays, fixed-length periods, fiscal quarters, week or custom-period pickers), (4) a calendar sits next to time slots, presets or a toolbar, or (5) any task involving Calendar, useCalendar, getDayProps, renderDay, excludeDate, getMonthControlProps, Month, Day, CalendarHeader or PickerControl.
/mantine-comboboxBuild custom dropdown/select/autocomplete/multiselect components using Mantine's Combobox primitives. Use this skill when: (1) creating a new custom select-like component with Combobox primitives, (2) building a searchable dropdown, (3) implementing a multi-select or tags input variant, (4) customizing option rendering, (5) adding custom filtering logic, or (6) any task involving useCombobox, Combobox.Target, Combobox.Option, or Combobox.Dropdown.
/mantine-custom-componentsBuild custom components that integrate with Mantine's theming, Styles API, and core features. Use this skill when: (1) creating a new component using factory(), polymorphicFactory(), or genericFactory(), (2) adding Styles API support (classNames, styles, vars, unstyled), (3) implementing CSS variables via createVarsResolver, (4) building compound components with sub-components and shared context, (5) registering a component with MantineProvider via Component.extend(), or (6) any task involving Factory, useProps, useStyles, BoxProps, StylesApiProps, or ElementProps in @mantine/core.
npx claudepluginhub mantinedev/skills --plugin mantineOther plugins' skills for the same job