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

Row Full Width

Create full width rows in LyteNyte Grid that render a single cell spanning the entire viewport.

Full Width Row Predicate

Use rowFullWidthPredicate on the grid state to determine whether a row renders as a full width row. A full width row spans the entire viewport and replaces the standard row that would otherwise render in the same position.

Full width rows always span the viewport and remain visible during horizontal scrolling. Use them for section headers, summary rows, or other specialized content within the grid.

In the demo below, full width rows group data by the exchange on which each crypto symbol trades. This pattern is a common use case for full width rows.

Full Width Rows

The demo uses rowFullWidthRenderer to provide a React component for rendering full width rows. This renderer can return any React component. In the demo, the component renders the exchange name and logo centered within the row, as shown below.

export function FullWidthCell({
grid: { api },
row,
}: RowFullWidthRendererParams<DEXPerformanceData>) {
if (!api.rowIsLeaf(row) || !row.data) return null;
const name = row.data.exchange;
const image = exchanges[name];
return (
<div>
<div>
<img src={image} alt={`Logo for exchange \${name}`} />
</div>
<div>{name}</div>
</div>
);
}

Grid Full Width Component

LyteNyte Grid treats full width rows as a distinct row type. When rendering rows in a headless setup, handle full width rows explicitly, as shown below. For details on the individual component parts, see the Headless Component Parts guide.

<Grid.RowsCenter>
{view.rows.center.map((row) => {
if (row.kind === "full-width") return <Grid.RowFullWidth row={row} />;
return <Grid.Row row={row} key={row.id} />;
})}
</Grid.RowsCenter>

Next Steps

  • Row Pinning: Freeze rows at the top or bottom of the viewport.
  • Row Sorting: Learn how to sort and order rows.
  • Row Spanning: Span cells across multiple rows.
  • Row Dragging: Drag rows within a grid or between grids and external drop zones.