Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material-UI definition list

I'm trying to achieve the following using React Material-UI, minus the expansion carets on the right:

list with right items

Here's the spec on the Google page. https://material.io/guidelines/components/expansion-panels.html#expansion-panels-usage

I've found that there's no exact component for this style. I basically have a bunch of summary data that I want to display but I feel like a Table or just a straight Material List with subheadings is not appropriate. I guess I really want a html definition list basically. Does anyone have any idea how to do this? Just looking for really an idea of how I could do it with the existing material components.

Thanks!

like image 827
coolboyjules Avatar asked Oct 29 '22 07:10

coolboyjules


1 Answers

I'm kinda late to the party, but here's how I'll do it:

<Grid 
  container
  component='dl' // mount a Definition List
  spacing={2}>
  <Grid item>
    <Typography component='dt' variant='h6'> 
      Some Heading or Definition Term
    </Typography>
    <Typography component='dd' variant='body2'>
      Some Definition data
    </Typography>
  </Grid>
</Grid>

I implemented a similar solution as above. You can switch the containers around to suit your specific need.

like image 168
krebeDev Avatar answered Nov 09 '22 12:11

krebeDev