Skip to content

Data grid - Row pinning

Pin rows to keep them visible at all times.

Pinned (or frozen, locked or floating) rows are those visible at all times while the user scrolls the grid vertically.

You can pin rows at the top or bottom of the grid by passing pinned rows data through the pinnedRows prop:

const pinnedRows: GridPinnedRowsProp = {
  top: [{ id: 0, brand: 'Nike' }],
  bottom: [
    { id: 1, brand: 'Adidas' },
    { id: 2, brand: 'Puma' },
  ],
};

<DataGridPro pinnedRows={pinnedRows} />;

The data format for pinned rows is the same as for the rows prop (see Feeding data).

Pinned rows data should also meet Row identifier requirements.

Name
City
Username
Email
Age
Kevin Vasquez
Geahama
@unrije
aglav@sahwod.ms
56
Lily Walsh
Gamjoko
@ba
gimvehe@mivvohjes.tv
63
Jeanette Flowers
Fokbafuv
@da
so@nij.tp
47
Todd Walton
Socgoki
@cowku
wiojamu@mekde.gn
79
Rhoda Reynolds
Zesemin
@roh
lohzaf@cijke.mu
31
Florence Craig
Vorarani
@ze
wugecaj@ab.nf
56
Sylvia Washington
Sefophu
@ve
tuoj@cuzgiaze.fi
62
Lena Clarke
Basporgew
@cafacif
hefvahde@to.la
10
Alexander Hansen
Hivivsod
@bom
tomerfuv@nosifbov.kw
35
Abbie Webster
Bekamet
@itog
koba@wamo.mh
61
Total Rows: 10
Press Enter to start editing

Controlling pinned rows

You can control which rows are pinned by changing pinnedRows.

In the demo below we use actions column type to add buttons to pin a row either at the top or bottom and change pinnedRows prop dynamically.

Name
City
Username
Email
Randall Moss
Vijuwaguw
@oniti
hubow@nuwvekejo.cd
Nettie Murray
Kibogvib
@dabol
kilifoz@furohi.mx
Hunter Osborne
Opujuod
@tan
sehini@igi.gr
Fannie Austin
Eguowudu
@pa
nalnot@buheum.sh
Arthur Blake
Uhofelkev
@zocviz
pafi@juza.ga
Joe Hughes
Uzavuje
@ciipzu
povat@pi.tl
Clara Massey
Relrurwe
@su
conjihvin@gavnof.et
Pauline Peters
Luanefi
@tozba
so@eso.zm
Lou Campbell
Akunuzi
@gor
luv@ezpabke.mx
Lucille Beck
Obiodinu
@dopde
luzoni@coz.er
Victor Underwood
Rilaipu
@fuzafepi
ithi@si.cn
Total Rows: 20

Usage with other features

Pinned rows are not affected by sorting and filtering.

Pagination does not impact pinned rows as well - they stay pinned regardless the page number or page size.

No rows
Desk
Commodity
Trader Name
Trader Email
Quantity
Filled Quantity
Is Filled
Status

Rows per page:

0–0 of 0

API