I am using material ui button in my project. Initially the add button is having only + icon.
When the mouse is hovered I need to change the content of button from the icon to the text "CREATE ITEM"
The code is as follows.
import Fab from '@material-ui/core/Fab';
import AddIcon from '@material-ui/icons/Add';
import { makeStyles } from '@material-ui/core/styles';
const useStyles = makeStyles(theme => ({
iconHover: {
'&:hover': {
border: '2px solid green',
//TODO display the text CREATE ITEM instead of AddIcon
}
},
floatBtn: {
marginRight: theme.spacing(1),
},
}));
const Index = () => {
const classes = useStyles();
return(
<div className={classes.floatBtn}>
<Fab size="small" color="secondary" aria-label="add" className={classes.iconHover}>
<AddIcon />
</Fab>
</div>
)};
Any idea on how to achieve this?