DocsAPI Reference

API Reference

State Options

All the state options that can be used in Shadcn Table

Many of the state options you can pass here are the same as the ones you can pass to the TanStack Table v9 useTable hook. Read them back from table.state.

Here is a list of all the state options you can pass to initialState or state.

const table = useShadcnTable({
  columns,
  data,
  //note: each individual state must be mutually exclusive to `initial state` or `state`
  initialState: {
    // all the state options you can pass here
  },
  state: {
    // or here
  },
});
#
State Option
Type
Default Value
More Info Links
1{ [key: string]: ST_FilterFn }
2Array<{id: string, value: unknown}>{}TanStack Table Filters Docs
3Array<string>[]TanStack Table Column Ordering Docs
4{ start: Array<string>, end: Array<string> }{ left: [], right: [] }TanStack Table Column Pinning Docs
5ST_ColumnResizingState{}TanStack Table Column Sizing Docs
6Record<string, number>{}TanStack Table Column Sizing Docs
7Record<string, boolean>{}TanStack Table Column Visibility Docs
8ST_Row
9'comfortable' | 'compact' | 'spacious''comfortable'
10ST_Column | null
11ST_Row | null
12ST_Cell
13ST_Row
14Record<string, boolean> | boolean{}TanStack Table Expanding Docs
15anyTanStack Table Filtering Docs
16ST_FilterFn
17Array<string>[]TanStack Table Grouping Docs
18ST_Column | null
19ST_Row | null
20booleanfalse
21booleanfalse
22booleanfalse
23{ pageIndex: number, pageSize: number } { pageIndex: 0, pageSize: 10 }TanStack Table Pagination Docs
24{ top: string[], bottom: string[] }{ top: [], bottom: [] }TanStack Table Column Pinning Docs
25Record<string, boolean>{}TanStack Table Row Selection Docs
26booleanfalse
27booleanfalse
28booleanfalse
29booleanfalse
30booleanfalse
31booleanfalse
32booleanfalse
33Array<{ id: string, desc: boolean }>[]TanStack Table Sorting Docs

Wanna see the source code for this table? Check it out down below!