Column Visibility

Hide columns by default, or let users show and hide them from the column editor.

Hide a column by default

Set hide: true on a column def. Users can still show it again when the column editor is enabled.

TypeScript
{
accessor: "internalId",
label: "Internal ID",
width: 100,
hide: true,
}

Enable the column editor

Set enableColumnEditor so users can search, toggle, and reorder columns from the Columns panel.

React TSX
<SimpleTable columns={columns} rows={rows} height="400px" enableColumnEditor={true} />

Open the editor on load

Pair with enableColumnEditorInitOpen to open the panel when the table mounts.

React TSX
<SimpleTable columns={columns} rows={rows} height="400px" enableColumnEditor={true} enableColumnEditorInitOpen={true} />

Exclude from table and editor

Use excludeFromRender for data you still want in CSV export but not in the grid or visibility menu (e.g. ids).

TypeScript
{
accessor: "id",
label: "ID",
width: 80,
excludeFromRender: true,
}

Example

Open the Columns panel to toggle visibility and reorder columns.

Custom column editor layout

Pass customRenderer on columnEditorConfig to replace the default popout. See ColumnEditorConfig.

React TSX
<SimpleTable
enableColumnEditor
columns={columns}
rows={rows}
columnEditorConfig={{
customRenderer: ({ searchSection, listSection, resetColumns }) => (
<>
{searchSection}
{listSection}
<button type="button" onClick={resetColumns}>Reset</button>
</>
),
}}
/>

Custom editor row layout

Use rowRenderer to control each row. Props are documented under ColumnEditorRowRendererProps.

React TSX
<SimpleTable
enableColumnEditor
columns={columns}
rows={rows}
columnEditorConfig={{
rowRenderer: ({ components }) => (
<div style={{ display: "flex", gap: 8, alignItems: "center" }}>
{components.checkbox}
{components.labelContent}
{components.dragIcon}
</div>
),
}}
/>

Props

Column Visibility Configuration

PropertyRequiredDescriptionExample
ColumnDef.hide
boolean
Optional
When true, the column starts hidden.
enableColumnEditor
boolean
Optional
Shows the Columns panel so users can toggle and reorder columns.
enableColumnEditorInitOpen
boolean
Optional
Opens the Columns panel on load. Requires enableColumnEditor.
columnEditorConfig.showToggle
boolean
Optional
When false, hides the built-in Columns strip. Open the editor with tableRef.current.toggleColumnEditor(). Default: true.
onColumnVisibilityChange
(visibilityState: ColumnVisibilityState) => void
Optional
Fires with a map of accessor → visible when visibility changes. Use it to sync or persist preferences.
ColumnDef.excludeFromRender
boolean
Optional
Omits the column from the table and column editor, but still includes it in CSV exports.