LyteNyte Grid logo for light mode. Links back to the documentation home page.
Columns

Column Floating Header

LyteNyte Grid's floating row is a specialized header row that appears below the main column headers.

Floating header rows let you render custom components for each column. While often used for filtering components, it can render any type of component.

Enable the floating row by setting the floatingRowEnabled property on the grid state. Once enabled, each column can define a floating cell renderer through the floatingCellRenderer property.

Set the floatingCellRenderer property on the column definition to a React component that LyteNyte Grid can use to render the column’s floating cell content.

Floating Component Renderer

When the floating row is enabled, LyteNyte Grid uses each column’s floatingCellRenderer to decide what to render in the floating cell. The demo below shows a simple renderer that provides a basic text filter input.

Column Floating Cell

Fork code on stack blitzFork code on code sandbox

Floating Row Visibility Toggling

You can show or hide the floating row by toggling the floatingRowEnabled state. The demo below includes a switch that updates this state:

Floating Cell Visibility

Fork code on stack blitzFork code on code sandbox

The toggle simply flips the floatingRowEnabled value:

<SwitchToggle
label="Toggle Floating Row"
checked={floatingRowEnabled}
onChange={() => {
setFloatingRowEnabled((prev) => !prev);
}}
/>

Next Steps

  • Column Resizing: Change column widths programmatically or via user interaction.
  • Column Moving: Reorder columns programmatically or through drag-and-drop.
  • Column Base: Learn how to specify default configuration options for columns.
  • Column Header Height: Set the height of the column header and column group header.