Browse components

Typography

import Typography from "@shpaw415/mui-lite/Typography";

Why use it

Use Typography for all readable text so font family, weight, and theme colors stay consistent. Prefer it over raw headings and paragraphs when you need `sx`, color tokens, or a polymorphic `Element` tag.

Demo

Variants (scale)

h1 Heading

h2 Heading

h3 Heading

h4 Heading

h5 Heading
h6 Heading
subtitle1
subtitle2

body1 — default paragraph text.

body2 — secondary body.

captionoverline
Colors

Primary color

Secondary color

Error color

Warning color

Success color

textSecondary / muted

Semantic Element + variant

Element="h1"

Element h2 + variant h2

variant h5 as <h1>

Example

import Typography from "@shpaw415/mui-lite/Typography";
 
export function Title() {
  return (
    <>
      {/* variant drives size/weight (wins over Tailwind preflight) */}
      <Typography variant="h1">Page title</Typography>
      <Typography variant="h2">Section</Typography>
      <Typography variant="body1">Body copy</Typography>
      <Typography color="primary">Highlighted body</Typography>
      {/* Semantic tag + type scale independently */}
      <Typography variant="h5" component="h1">
        Visual h5, semantic h1
      </Typography>
    </>
  );
}

Props

PropTypeDefault
varianth1–h6 | subtitle1/2 | body1/2 | caption | button | overlinebody1
Element / componentHTML tag namefrom variant
colorprimary | secondary | error | warning | success | textSecondary
alignleft | center | right | justifyinherit
gutterBottom / noWrap / paragraphbooleanfalse
sxSxProps