When it comes to choosing between the <Typography/>
tag and normal HTML tags like <p>
, I find myself in a state of ambiguity.
<Box className={someClassName}>
<Typography>{someVariableName}</Typography>
</Box>
or
<p className="someClassName">{someVariableName}</p>
Both options serve the same purpose, however MUI Typography is a concept introduced by MUI that I have noticed being used in MUI apps. My question is what specific advantage do I gain from using the <Typography>
tag? While styling it, I need to use 2 tags: <Box>
and <Typography>
.
On the other hand, with HTML, I can save some typing by simply using <p>
tags or <h1>
tags for text display. So, why should I opt for <Typography>
?
Only on the <Box>
element can I add CSS classes, but with HTML, I can apply CSS directly either inline or through class names on <p>
tags.