Overview
TheuseHeaderRowSelection hook is used within custom header cell renderers to implement custom “select all” functionality. It provides access to the selection state across all rows and a callback to change the selection.
Signature
Return Value
Whether some (but not all) rows are selected. Use this for the indeterminate state of a checkbox.
Whether all rows are selected.
Callback function to change the selection state of all rows.
SelectHeaderRowEvent Type
Whether all rows should be selected (true) or deselected (false).
Usage
This hook must be called within a custom header cell renderer. It’s commonly used withuseLayoutEffect to handle the indeterminate state of checkboxes.
Error Handling
The hook will throw an error if used outside of a header cell renderer:Related
- useRowSelection - Hook for row selection in cell renderers
- SelectColumn - Pre-configured column for row selection
- renderCheckbox - Default checkbox renderer