Usage
Use Title component to render h1-h6 headings with Mantine theme styles.
By default, Title
has no margins and paddings.
You can change font-size
, font-weight
and line-height
per heading with theme.headings.
Set order
prop to render a specific element (h1-h6), default order is 1
:
This is h1 title
This is h2 title
This is h3 title
This is h4 title
This is h5 title
This is h6 title
Size
You can change Title size
independent of its order
:
- If you set size to
h1
-h6
, then component will add correspondingfont-size
andline-height
from the theme - If you set size to any other value, then
line-height
will be calculated based onorder
–size
will impact onlyfont-size
H3 heading with h1 font-size
H1 heading with h4 font-size
H1 heading with 1rem size
H1 heading with xs size
Text wrap
Use textWrap
prop to control text-wrap
CSS property. It controls how text inside an element is wrapped.
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quasi voluptatibus inventore iusto cum dolore molestiae perspiciatis! Totam repudiandae impedit maxime!
Text wrap
You can also set textWrap
on theme:
Line clamp
Set lineClamp
prop to truncate text after specified number of lines:
Lorem ipsum dolor sit amet consectetur adipisicing elit. Iure doloremque quas dolorum. Quo amet earum alias consequuntur quam accusamus a quae beatae, odio, quod provident consectetur non repudiandae enim adipisci?
Line clamp