March 2019
Intermediate to advanced
534 pages
14h 52m
English
Let's say that you have several list items that can be divided into three sections. You can use three List components to group your items into their respective sections, and use a Divider component to visually indicate the section boundary for the user. Here's what the code looks like:
import React, { Fragment } from 'react';import List from '@material-ui/core/List';import ListItem from '@material-ui/core/ListItem';import ListItemText from '@material-ui/core/ListItemText';import Divider from '@material-ui/core/Divider';const ListSections = () => ( <Fragment> <List> <ListItem> <ListItemText primary="First" /> </ListItem> <ListItem> <ListItemText primary="Second" /> </ListItem> </List> <Divider /> <List> <ListItem> <ListItemText ...Read now
Unlock full access