Shadcn React Table

Search documentation

Search the docs

Custom icons

Every glyph is a named slot. Override any subset with the icons option, which accepts a partial. Defaults come from Remix Icon, but you can swap in any icon library.

Custom icons
GitHub
ID
2261
45000134754
099
AvaThompsonOwnerEngineeringactive22$45,000Jan 2, 2023
0%
LiamNguyenAdminMarketinginactive25$47,137Jan 13, 2023
9%
NoahSilvaEditorDesignpending28$49,274Jan 24, 2023
18%
EmmaCarterViewerSalesactive31$51,411Feb 4, 2023
27%
OliviaRossiOwnerSupportinactive34$53,548Feb 15, 2023
36%
WilliamWalkerAdminEngineeringpending37$55,685Feb 26, 2023
45%
SophiaPatelEditorMarketingactive40$57,822Mar 9, 2023
54%
JamesMullerViewerDesigninactive43$59,959Mar 20, 2023
63%
IsabellaParkOwnerSalespending46$62,096Mar 31, 2023
72%
LucasReyesAdminSupportactive49$64,233Apr 11, 2023
81%
$4,120,536
Rows per page
1–10 of 48

Each value is a component that accepts a className, so any icon library works — here using lucide-react:

import { DataTable, useDataTable } from "@/components/ui/data-table"
import { ArrowDown, ArrowUp, Search } from "lucide-react"

const table = useDataTable({
  data,
  columns,
  getRowId: (row) => row.id,
  icons: {
    sortAscending: ArrowUp,
    sortDescending: ArrowDown,
    search: Search,
  },
})

return <DataTable table={table} />

App-wide defaults

For icon (and localization) defaults shared across many tables, wrap a subtree in DataTableConfigProvider.

import { DataTableConfigProvider } from "@/components/ui/data-table"
import { Search } from "lucide-react"

<DataTableConfigProvider icons={{ search: Search }}>
  {children}
</DataTableConfigProvider>

Precedence

Values resolve in this order: built-in defaults → DataTableConfigProvider → per-call options. Per-call icons always win.