# StickyRowsPlugin

> _Since v2.7.0_

Sticky Rows plugin for `<tbw-grid>`.

Marks specific rows as "sticky" so they pin below the grid header when their
natural scroll position would take them off-screen. Behavior when multiple
sticky rows would be stuck simultaneously is controlled by `mode`:

- `'push'` (default) — only one stuck at a time; the next sticky row pushes
  the previous one out of view (iOS section-header behavior).
- `'stack'` — sticky rows stack below the header up to `maxStacked`.

The plugin renders **clones** of the real rows; the originals continue to
exist in the data flow. Clones inherit the row's grid-template alignment so
they line up perfectly with the column boundaries below.

## [Configuration Options](/grid/plugins/sticky-rows/interfaces/stickyrowsconfig.md)

| Option | Type | Description |
| ------ | ---- | ----------- |
| `isSticky` | <code>string &#124; <a href="/grid/plugins/sticky-rows/types/stickypredicate/">StickyPredicate</a></code> | Either a field name on the row (truthy value marks the row as sticky) or a predicate that returns a truthy/falsy value per row. |
| `mode?` | <code><a href="/grid/plugins/sticky-rows/types/stickyrowsmode/">StickyRowsMode</a></code> | Behavior when multiple sticky rows would be stuck simultaneously. |
| `maxStacked?` | <code>number</code> | Maximum number of rows stacked below the header in `'stack'` mode. Ignored in `'push'` mode (which is always 1). |
| `className?` | <code>string</code> | Optional class added to the stuck-row clones for custom styling. |

## Example

```ts
import '@toolbox-web/grid/features/sticky-rows';

grid.gridConfig = {
  features: { stickyRows: { isSticky: 'isSection', mode: 'stack' } },
};
```

## See Also

- [`StickyRowsConfig`](/grid/plugins/sticky-rows/interfaces/stickyrowsconfig.md) for all configuration options.
- Extends BaseGridPlugin.

> **Extends** [BaseGridPlugin](/docs/grid-api-plugin-development-classes-basegridplugin--docs)
>
> Inherited methods like `attach()`, `detach()`, `afterRender()`, etc. are documented in the base class.
