Visibility
The visibility feature provides methods and state for controlling which columns are visible in the table. These properties are available on the table instance when using the column visibility feature. See the column visibility guide for usage examples and configuration details.
| Prop | Type |
|---|---|
If column pinning, returns a flat array of leaf-node columns that are visible
in the unpinned/center portion of the table. | () => Column< |
Returns whether all columns are visible | () => boolean |
Returns whether any columns are visible | () => boolean |
If column pinning, returns a flat array of leaf-node columns that are visible
in the left portion of the table. | () => Column< |
If column pinning, returns a flat array of leaf-node columns that are visible
in the right portion of the table. | () => Column< |
Returns a handler for toggling the visibility of all columns, meant to be bound
to a input[type=checkbox] element. | () => ( |
Returns a flat array of columns that are visible, including parent columns. | () => Column< |
Returns a flat array of leaf-node columns that are visible. | () => Column< |
Resets the column visibility state to the initial state. If defaultState is
provided, the state will be reset to {} | ( |
Sets or updates the state.columnVisibility state. | ( |
Toggles the visibility of all columns. | ( |
Type
() => Column<
TData,
unknown,
ColumnMeta
>[]
Description
If column pinning, returns a flat array of leaf-node columns that are visible
in the unpinned/center portion of the table.
Type
() => boolean
Description
Returns whether all columns are visible
Type
() => boolean
Description
Returns whether any columns are visible
Type
() => Column<
TData,
unknown,
ColumnMeta
>[]
Description
If column pinning, returns a flat array of leaf-node columns that are visible
in the left portion of the table.
Type
() => Column<
TData,
unknown,
ColumnMeta
>[]
Description
If column pinning, returns a flat array of leaf-node columns that are visible
in the right portion of the table.
Type
() => (
event: unknown,
) => void
Description
Returns a handler for toggling the visibility of all columns, meant to be bound
to a
input[type=checkbox] element.Type
() => Column<
TData,
unknown,
ColumnMeta
>[]
Description
Returns a flat array of columns that are visible, including parent columns.
Type
() => Column<
TData,
unknown,
ColumnMeta
>[]
Description
Returns a flat array of leaf-node columns that are visible.
Type
(
defaultState?: boolean,
) => void
Description
Resets the column visibility state to the initial state. If
defaultState is
provided, the state will be reset to {}Type
(
updater: Updater<VisibilityState>,
) => void
Description
Sets or updates the
state.columnVisibility state.Type
(
value?: boolean,
) => void
Description
Toggles the visibility of all columns.