Hide columns with columnVisibilityFeature while rendering visibility-aware header, column, and cell collections. Load when hidden columns remain in the DOM, false-versus-absent state is confused, or enableHiding is misunderstood.
73
92%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
This skill builds on core and table-features. Visibility state changes visibility-aware models; it never removes the column definition.
import { columnVisibilityFeature, tableFeatures } from '@tanstack/table-core'
export const features = tableFeatures({ columnVisibilityFeature })
export const initialState = { columnVisibility: { internalId: false } }const headers = table.getHeaderGroups()
const cells = row.getVisibleCells()
const toggles = table
.getAllLeafColumns()
.filter((column) => column.getCanHide())Use all-column APIs for controls and visible APIs for rendered table content.
Wrong: row.getAllCells().map(renderCell)
Correct: row.getVisibleCells().map(renderCell)
All-cell APIs intentionally include hidden columns.
Source: docs/framework/react/guide/column-visibility.md#column-visibility-aware-table-apis
Wrong: const hidden = !columnVisibility[column.id]
Correct: const hidden = columnVisibility[column.id] === false
Only explicit false hides a column; an absent entry is visible.
Source: packages/table-core/src/features/column-visibility/columnVisibilityFeature.ts
Wrong: helper.accessor('id', { enableHiding: false })
Correct: const initialState = { columnVisibility: { id: false } }
enableHiding controls whether hiding is allowed; visibility belongs in table state.
Source: packages/table-core/src/features/column-visibility/columnVisibilityFeature.types.ts
Inspect node_modules/@tanstack/table-core/dist/features/column-visibility/ for visibility-aware table, row, and column APIs.
9e523bc
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.