1// imports
2import IconButton from "@material-ui/core/IconButton";
3import InputAdornment from "@material-ui/core/InputAdornment";
4import SearchIcon from "@material-ui/icons/Search";
5
6// render
7
8<TextField
9 label="With normal TextField"
10 InputProps={{
11 endAdornment: (
12 <InputAdornment>
13 <IconButton>
14 <SearchIcon />
15 </IconButton>
16 </InputAdornment>
17 )
18 }}
19/>
20
1// if this helped, don't forget to upvote so others can see
2
3import React from 'react';
4import LocationOnIcon from '@material-ui/icons/LocationOn';
5import IconButton from '@material-ui/core/IconButton';
6
7export default function ButtonWithIcon () {
8
9 return(
10 <IconButton>
11 <LocationOnIcon />
12 </IconButton>
13 )
14}
1//surround the whatever Icon you have inside a <IconButton><IconButton/> tag
2this IconButton is being provided by @material-ui/core,so dont forget to import that
1npm install @material-ui/core
2npm install @material-ui/icons
3
4import RoomIcon from '@material-ui/icons/Room';
5
6<RoomIcon />
1<Button color="primary" onClick={() => { console.log('onClick'); }}>
2 Primary
3</Button>