H
H
Hasko2019-12-13 10:44:38
css
Hasko, 2019-12-13 10:44:38

How to add style to MaterialUi React component?

How to add style to element like top padding?
https://codesandbox.io/s/material-demo-1r2yo
As an option, of course I can do this, but it seems to me wrong.

const useStyles = makeStyles(theme => ({
  root: {
    marginTop: 10
  }
}));

const MainListItems = () => {
  const classes = useStyles();

  return (
    <div>
      <ListItem button className={classes.root}>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Goryachev, 2019-01-23
@AntonBrock

I would make the picture a background image.

E
Eugene Chefranov, 2019-01-23
@Chefranov

G
Gregory, 2019-12-13
@Loovery

Well, you can hardcode, but it will definitely be worse. So you have the option as described in the documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question