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

Select All

Use LyteNyte Grid's checkbox component to select all rows and render checked and indeterminate states.

Note

This guide assumes familiarity with row selection. See the Row Selection guide for details.

Select All Rendering

LyteNyte Grid exports the SelectAll component. Use it in a column header or any component with access to the grid API.

The demo below shows SelectAll in the marker column header. When checked, the grid selects all rows.

Select All Implementation

Fork code on stack blitzFork code on code sandbox

The code below shows the SelectAll component. LyteNyte Grid also exports a Checkbox for rendering the indeterminate state, though you can use your own checkbox component instead.

<SelectAll
api={params.api}
slot={({ indeterminate, selected, toggle }) => {
return (
<Checkbox
checked={selected}
indeterminate={indeterminate}
onClick={(ev) => {
ev.preventDefault();
toggle();
}}
onKeyDown={(ev) => {
if (ev.key === "Enter" || ev.key === " ") toggle();
}}
/>
);
}}
/>

Why Use Select All

The SelectAll component manages all selection states. LyteNyte Grid supports two selection modes: linked and isolated. Each mode uses different rules to determine whether all rows are selected.

SelectAll handles those mode-specific differences and exposes a single, consistent interface for determining the overall selection status, rendering indeterminate states, and performing the correct select-all actions.

Select All Properties

The SelectAll component accepts the following properties.

Prop

Next Steps

  • Menu Button: Display a list of actions or options in an accessible dropdown menu.
  • Smart Select: Streamline data selection using a versatile combobox or select element.
  • Pill Manager: Create and manage grid interactions using label pills.