March 2019
Intermediate to advanced
534 pages
14h 52m
English
Icon buttons are especially useful when you're working with restricted screen real estate or when you want to visually show the toggled state of something. For example, it might be easier for a user to toggle the state of a microphone if the enabled/disabled state indicates the actual microphone.
Let's build on this idea and implement toggle controls for the microphone and volume in an app, using icon buttons. Here's the code:
import React, { useState } from 'react';import IconButton from '@material-ui/core/IconButton';import Grid from '@material-ui/core/Grid';import MicIcon from '@material-ui/icons/Mic';import MicOffIcon from '@material-ui/icons/MicOff';import VolumeUpIcon from '@material-ui/icons/VolumeUp';import VolumeOffIcon ...Read now
Unlock full access