Examples › Scrollable vs. auto-height

Try the interactive example below to see the feature it in action:

return (
  <DataTable
    height={300}
    // more table props...
  />
);
First name
Last name
Email
Department
Company
Address
City
State
JeraldHowellJerald.Howell32@yahoo.comIndustrialRunte Inc2996 Ronny MountMcAllenMA
KathleenRueckerKathleen_Ruecker@hotmail.comComputersShanahan, Robel and Beier378 Berta CrescentWest GerryKS
EricaVolkmanErica.Volkman37@gmail.comToysGoyette Inc8873 Mertz RapidDorthysideID
CliffordOberbrunnerClifford.Oberbrunner@hotmail.comAutomotiveRau - O'Hara7508 Lansdowne RoadShieldsboroughMI
AlisonKlingAlison16@gmail.comJeweleryGoyette Inc8873 Mertz RapidDorthysideID
SueZiemeSue.Zieme29@hotmail.comBooksCummerata - Kuhlman6389 Dicki StreamSouth GateNH
FeliciaGleasonFelicia30@yahoo.comShoesDoyle, Hodkiewicz and O'Connell576 Joyce WaysTyraburghKS
AlfredoZemlakAlfredo22@yahoo.comGamesRunte Inc2996 Ronny MountMcAllenMA
EmilyBartolettiEmily.Bartoletti@gmail.comAutomotiveRau - O'Hara7508 Lansdowne RoadShieldsboroughMI
DeloresReynoldsDelores.Reynolds@yahoo.comIndustrialRunte Inc2996 Ronny MountMcAllenMA
LouisSchambergerLouis6@yahoo.comToolsCummerata - Kuhlman6389 Dicki StreamSouth GateNH
BeverlyHellerBeverly_Heller@gmail.comBeautyRunte Inc2996 Ronny MountMcAllenMA
EugeneFeestEugene88@hotmail.comKidsGoyette Inc8873 Mertz RapidDorthysideID
MartinBahringerMartin_Bahringer10@gmail.comBeautyRau - O'Hara7508 Lansdowne RoadShieldsboroughMI
EllisMillerEllis36@hotmail.comElectronicsConnelly, Feest and Hodkiewicz7057 Stanley RoadKearaburghCA
No records

The DataTable component embeds a Mantine ScrollArea and has a default height of '100%'.
Thus, setting the component height or placing it inside a height-restricted container will turn on its “vertically-scrollable” behavior.

Customize the underlying ScrollArea

You can customize the underlying scroll area by passing scrollAreaProps to the DataTable component. The scrollAreaProps accepts a subset of Mantine ScrollArea props: type, scrollbarSize and scrollHideDelay. For instance, here’s how you could make the scrollbars invisible:

<DataTable
  height={300}
  // other props...
  scrollAreaProps={{ type: 'never' }}
/>

Here is the result:

First name
Last name
Email
Department
Company
Address
City
State
JeraldHowellJerald.Howell32@yahoo.comIndustrialRunte Inc2996 Ronny MountMcAllenMA
KathleenRueckerKathleen_Ruecker@hotmail.comComputersShanahan, Robel and Beier378 Berta CrescentWest GerryKS
EricaVolkmanErica.Volkman37@gmail.comToysGoyette Inc8873 Mertz RapidDorthysideID
CliffordOberbrunnerClifford.Oberbrunner@hotmail.comAutomotiveRau - O'Hara7508 Lansdowne RoadShieldsboroughMI
AlisonKlingAlison16@gmail.comJeweleryGoyette Inc8873 Mertz RapidDorthysideID
SueZiemeSue.Zieme29@hotmail.comBooksCummerata - Kuhlman6389 Dicki StreamSouth GateNH
FeliciaGleasonFelicia30@yahoo.comShoesDoyle, Hodkiewicz and O'Connell576 Joyce WaysTyraburghKS
AlfredoZemlakAlfredo22@yahoo.comGamesRunte Inc2996 Ronny MountMcAllenMA
EmilyBartolettiEmily.Bartoletti@gmail.comAutomotiveRau - O'Hara7508 Lansdowne RoadShieldsboroughMI
DeloresReynoldsDelores.Reynolds@yahoo.comIndustrialRunte Inc2996 Ronny MountMcAllenMA
LouisSchambergerLouis6@yahoo.comToolsCummerata - Kuhlman6389 Dicki StreamSouth GateNH
BeverlyHellerBeverly_Heller@gmail.comBeautyRunte Inc2996 Ronny MountMcAllenMA
EugeneFeestEugene88@hotmail.comKidsGoyette Inc8873 Mertz RapidDorthysideID
MartinBahringerMartin_Bahringer10@gmail.comBeautyRau - O'Hara7508 Lansdowne RoadShieldsboroughMI
EllisMillerEllis36@hotmail.comElectronicsConnelly, Feest and Hodkiewicz7057 Stanley RoadKearaburghCA
No records

Head over to the next example to discover more features.