material-ui iconbutton code example

Example 1: material ui icon button

// if this helped, don't forget to upvote so others can see

import React from 'react';
import LocationOnIcon from '@material-ui/icons/LocationOn';
import IconButton from '@material-ui/core/IconButton';

export default function ButtonWithIcon () {

  return(
    <IconButton>
      <LocationOnIcon />
    </IconButton>
  )
}

Example 2: @material-ui/icons

yarn add @material-ui/icons

# NPM
npm install @material-ui/icons

Example 3: react mui icons

npm install @material-ui/core
npm install @material-ui/icons

import RoomIcon from '@material-ui/icons/Room';

<RoomIcon />