Skip to content

Column Options

Options of a column definition (MRT_ColumnDef). A data column needs header and an accessorKey, or an accessorFn plus an id. Capitalized options (Cell, Header, …) are snippets.

Column definitions also accept the TanStack Table v9 column options of the enabled features, such as enableSorting, enableHiding, size or aggregationFn.

NameTypeDescription
accessorFn?(originalRow: TData) => TValueEither an accessorKey or a combination of an accessorFn and id are required for a data column definition.
accessorKey?DeepKeys<TData> | (string & {})Which key in the row this column should use to access the correct data. Also supports deep key dot notation.
AggregatedCell?Snippet<[MRT_CellContext<TData, TValue>]>Snippet for the cell of a grouped row’s aggregated value.
aggregationFn?Array<MRT_AggregationFn> | MRT_AggregationFn
Cell?Snippet< [MRT_CellContext<TData, TValue> & { renderedCellValue: unknown }] >Snippet that replaces the default cell contents.
cellActionMenuItems?Snippet< [ MRT_CellContext<TData> & { closeMenu: () => void; internalMenuItems: Snippet[]; }, ] >
columnActionsButtonProps?PropsOrFn<SmuiProps, MRT_ColumnContext<TData>>
columnActionsMenuItems?Snippet< [ MRT_ColumnContext<TData> & { closeMenu: () => void; internalColumnMenuItems: Snippet[]; }, ] >
columnDefType?'data' | 'display' | 'group'Specify what type of column this is. Either data, display, or group. Defaults to data.
columnDragHandleProps?PropsOrFn<SmuiProps, MRT_ColumnContext<TData>>
columnFilterModeMenuItems?Snippet< [ MRT_ColumnContext<TData> & { internalFilterOptions: MRT_InternalFilterOption[]; onSelectFilterMode: (filterMode: MRT_FilterOption) => void; }, ] >
columnFilterModeOptions?Array< LiteralUnion<string & MRT_FilterOption> > | null
columns?MRT_ColumnDef<TData, TValue>[]
copyButtonProps?PropsOrFn<SmuiProps, MRT_CellContext<TData, TValue>>
Edit?Snippet<[Omit<MRT_CellContext<TData, TValue>, 'staticColumnIndex'>]>Snippet for a fully custom edit input.
editSelectOptions?| ((context: MRT_CellContext<TData, TValue>) => DropdownOption[]) | DropdownOption[]
editTextFieldProps?PropsOrFn<SmuiProps, MRT_CellContext<TData, TValue>>
editVariant?'select' | 'text'
enableClickToCopy?| 'context-menu' | ((cell: MRT_Cell<TData>) => 'context-menu' | boolean) | boolean
enableColumnActions?boolean
enableColumnDragging?boolean
enableColumnFilterModes?boolean
enableColumnOrdering?boolean
enableEditing?((row: MRT_Row<TData>) => boolean) | boolean
enableFilterMatchHighlighting?boolean
Filter?Snippet< [ MRT_ColumnContext<TData, TValue> & { header: MRT_Header<TData>; rangeFilterIndex?: number; }, ] >Snippet for a fully custom filter input.
filterAutocompleteProps?PropsOrFn<SmuiProps, MRT_ColumnContext<TData>>
filterCheckboxProps?PropsOrFn<SmuiProps, MRT_ColumnContext<TData>>
filterDateInputProps?PropsOrFn< SmuiProps, MRT_ColumnContext<TData> & { rangeFilterIndex?: number } >Props for the native \<input type="date | datetime-local | time"\> filters.
filterFn?MRT_FilterFn
filterSelectOptions?DropdownOption[]
filterSliderProps?PropsOrFn<SmuiProps, MRT_ColumnContext<TData>>
filterTextFieldProps?PropsOrFn< SmuiProps, MRT_ColumnContext<TData> & { rangeFilterIndex?: number } >
filterVariant?| 'autocomplete' | 'checkbox' | 'date' | 'date-range' | 'datetime' | 'datetime-range' | 'multi-select' | 'range' | 'range-slider' | 'select' | 'text' | 'time…
footer?stringfooter must be a string. For custom markup, specify a Footer snippet. (Capital F)
Footer?Snippet< [MRT_ColumnContext<TData, TValue> & { footer: MRT_Header<TData> }] >
GroupedCell?Snippet<[MRT_CellContext<TData, TValue>]>Snippet for the cell of a grouped row’s grouping value.
grow?boolean | numberIf layoutMode is 'grid' or 'grid-no-grow', specify the flex grow value for individual columns, or false/0 to not grow.
headerstringheader must be a string. For custom markup, specify a Header snippet. (Capital H)
Header?Snippet< [MRT_ColumnContext<TData, TValue> & { header: MRT_Header<TData> }] >
id?LiteralUnion<string & keyof TData>id defaults to the accessorKey or header if not specified.
PlaceholderCell?Snippet<[MRT_CellContext<TData, TValue>]>
sortFn?MRT_SortFn
tableBodyCellProps?PropsOrFn< ElementProps<'td'>, MRT_CellContext<TData, TValue> >
tableFooterCellProps?PropsOrFn< ElementProps<'td'>, MRT_ColumnContext<TData> >
tableHeadCellProps?PropsOrFn<ElementProps<'th'>, MRT_ColumnContext<TData>>
visibleInShowHideMenu?boolean