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
Rosie Fox
Pofidro
@omufe
jeb@unali.hm
29
Lucas Swanson
Vemeac
@jivuna
uwe@tenuwip.sk
13
Jeremiah Carroll
Bafiluhi
@custisvi
uzuze@niw.tr
80
Bettie Atkins
Fabciwres
@buzizoj
upa@ewcef.bm
16
Hettie Mendoza
Fuwdamfac
@likizih
dejedse@se.id
79
Sara May
Ziwofuor
@guv
kuzeljop@bu.me
76
Steven Klein
Mazlimti
@bintav
wa@wa.gp
41
Dennis Campbell
Benoci
@icafefac
moskel@vubpikut.va
11
Harriett Parks
Fubehuba
@maolijo
olu@rucit.hm
52
Cecelia Reeves
Ejuunelaf
@guf
mi@bawdu.ms
64
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
Aiden Rowe
Zizrahzuc
@jeruz
hula@giz.si
Milton Conner
Pujowa
@nupzu
lin@vosaz.is
Ruth Fitzgerald
Guurakih
@mippi
lulingiz@jic.la
Emily Powers
Nadpaci
@ekzi
rama@deconovi.tf
Elijah Glover
Suvjepiw
@necsifluf
piwped@hiv.ly
Dale Jefferson
Inurko
@mok
uc@reh.ls
Joel Long
Sibpobnat
@riugelek
vedef@ig.nr
Minnie Larson
Rivalit
@ah
zavgimwit@nafucib.pl
Donald Sanchez
Lacfazog
@zohema
en@daced.br
Edith Gonzales
Jilbabus
@hodu
wupocavaj@ohlobo.mn
Mitchell Simpson
Besbeovu
@laccetgih
bugela@woso.at
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