Button Multiline Typography

Viewed 649

for me it is not possible to create a Button with Material-Ui in React which has Multiline.

This is My Code:

<Button>
<Typography variant="h3">Text1</Typography>
<Typography variant="h5">Text2</Typography>
</Button>

Current result: Text1Text2

I want this:

Text1
Text2

The first text should be variant=h3 and the second text variant v=5. Thanks!!!

1 Answers

you can make the button display style as block . and align the text as per your requirement.

Explore Working solution here : Edit react-select-test (forked)

<Button style={{ display: "block", textAlign: "left" }}>
        <Typography
          variant="h3"
        >
          Text1
        </Typography>
        <Typography variant="h5">Text2</Typography>
      </Button>

Related