# Shadcn Column Icons

> Data grid with column icons

- Type: example, free and open source (MIT)
- Component: [Data Grid](https://reui.io/components/data-grid.md)
- Page: https://reui.io/components/data-grid/c-data-grid-10
- Docs (Base UI): https://reui.io/docs/components/base/data-grid.md
- Docs (Radix UI): https://reui.io/docs/components/radix/data-grid.md
- MCP: `get_example("c-data-grid-10")`
- Registry item: https://reui.io/r/styles/base-nova/c-data-grid-10.json
- Uses: Avatar, Data Grid

## Best for

An icon beside each header title, with sorting switched off so every header is a static label

## Agent notes

- Every column sets `enableSorting` to false, so `DataGridColumnHeader` renders a plain label; turn it on to get the sort button with the icon kept

## Third-party libraries

- TanStack Table v9: [API reference](https://tanstack.com/table/v9/docs/framework/react/reference/index), [docs](https://tanstack.com/table/v9/docs/framework/react/quick-start)

## Install

```bash
npx shadcn@latest add @reui/c-data-grid-10
```

## About Shadcn Data Grid

### When to use

- Admin and back office tables that sort, filter, paginate and select rows
- Spreadsheet style editing with cell selection, clipboard and inline edits
- Large record sets that need virtualized rows, columns or infinite scroll

### When not to use

- A short static list of rows with no sorting or paging: use [Table](https://reui.io/components/table.md) (`get_component("table")`)
- Records moved as cards between status columns: use [Kanban](https://reui.io/components/kanban.md) (`get_component("kanban")`)
- A folder or category hierarchy with no columns of data: use [Tree](https://reui.io/components/tree.md) (`get_component("tree")`)

### Agent notes

- With `manualPagination`, pass the server total to `useTable` as `rowCount` as well as `recordCount`, or the page buttons never render
- Give `useTable` a stable `getRowId` whenever rows can be pinned, reordered or virtualized
- Swap `DataGridTable` for `DataGridTableVirtual` when rows need virtualization or infinite scroll

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
