mocco
mocco

Reputation: 154

Font Family does not work in ListItemText

Why fontFamily does not work below?

<ListItemText style={{fontFamily:"Times New Roman"}} primary="Sent mail" />

But if I add color it works. Example: https://codesandbox.io/s/r3u1d

Is it possible to add my own font family to ListItemText?

Cheers,

Upvotes: 1

Views: 1457

Answers (2)

Ruslan Elisha
Ruslan Elisha

Reputation: 131

You are using material-ui library, and the solution is hidden in their API:

https://material-ui.com/api/list-item-text/#props

Just use disableTypography prop in ListItemText Component

Here is a modified example:

https://codesandbox.io/s/material-demo-pedw3?file=/demo.tsx

Upvotes: 3

Harry
Harry

Reputation: 1

Try using font-family instead of fontFamily.

Upvotes: 0

Related Questions