March 2019
Intermediate to advanced
534 pages
14h 52m
English
Let's say that you want to support different types of drawers in your app. You can control the Drawer component type using the variant property. Here's the code:
import React, { useState } from 'react';import Drawer from '@material-ui/core/Drawer';import Grid from '@material-ui/core/Grid';import Button from '@material-ui/core/Button';import List from '@material-ui/core/List';import ListItem from '@material-ui/core/ListItem';import ListItemIcon from '@material-ui/core/ListItemIcon';import ListItemText from '@material-ui/core/ListItemText';export default function DrawerTypes({ classes, variant }) { const [open, setOpen] = useState(false); return ( <Grid container justify="space-between"> <Grid item> <Drawer variant={variant} ...Read now
Unlock full access