How to do it...

Let's say that you have three panels, each with several paragraphs of text. Rather than having each panel adjust its height to accommodate the content, you can make the panels a fixed height and scrollable. Here's the code:

import React, { Fragment } from 'react';import { withStyles } from '@material-ui/core/styles';import ExpansionPanel from '@material-ui/core/ExpansionPanel';import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary';import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails';import Typography from '@material-ui/core/Typography';import ExpandMoreIcon from '@material-ui/icons/ExpandMore';const styles = theme => ({  panelDetails: {    flexDirection: 'column',    height: 150, overflow: ...

Get React Material-UI Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.