Rotate label – Material UI button

Tags: ,



I’ve got a button like this (material-ui):

//theme.js
export const XButtonTop = withStyles({
  root: {
    borderColor: medium_col,
    borderRadius: 1,
    borderTopLeftRadius: 16,
    borderTopRightRadius: 16,
    height: 28
  },
  label: {
    textTransform: "uppercase",
    fontSize: "10px"
  }
})(Button);

//App.js
import {
  XButtonTop
} from "../theme";

const Selector = state => {
return (
<div>
  <XButtonTop fullWidth size="small" disableElevation>
  )
  </XButtonTop>
</div>
)
}

I need to rotate the label (90 degrees).

Can someone help me please? Thanks

Answer

label: {
    textTransform: 'capitalize',
    transform: 'rotate(-90deg)',
  }

Then you may want to change the height of the button too. Something like this for the root:

height: 120,
width: 30


Source: stackoverflow