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
Devin Cain
Becatu
@anala
zul@vomguozu.tn
20
Lela Underwood
Nubili
@fangajzac
ju@tabhilar.zm
58
Elmer Norris
Soacaliz
@iwetivu
ma@hi.kw
16
Max Phelps
Noneafu
@rirmivdi
mek@wun.br
58
Hester Jenkins
Ziwalfid
@mizad
gobube@zegu.hk
74
Leroy Becker
Kopujide
@nipwifur
sabod@livor.sk
49
Thomas Norman
Awomuppej
@pasa
bupaj@kaf.org
72
Samuel Moran
Revahfo
@sazorzu
faareogu@nip.cl
64
Rachel Hardy
Zeiwaki
@si
fonoduf@ga.fo
18
Mark Atkins
Ehoheka
@futo
ozodepa@asasisdin.eg
30
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 Gonzales
Ikhozzad
@uwajo
ednekko@feg.mw
Ryan Brady
Ozipaila
@bifez
ogousli@ulcohpav.gh
Lilly Salazar
Ciocula
@sekrajog
kagcuk@geatuali.lu
Randall Bush
Josjufik
@naw
ma@dudce.bd
Bernard Summers
Bulolucu
@jipde
muppurso@azadef.ml
Lora Harrington
Adaebcol
@mesjomzi
diigmum@wemdasce.kr
Peter Nguyen
Bobuva
@lopip
vujewpe@ge.sj
Lena Harrington
Davive
@navlicit
ekce@uzoupo.mk
Nicholas Kim
Gescibig
@darhovib
fowpez@kopge.fr
Rosalie Hicks
Eriocacur
@wu
acimof@korow.tg
Jonathan Harmon
Mosewepo
@okbi
fut@loc.gl
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