Skip to main content

Heading

Import

import { Heading } from "@sparrowengg/twigs-react";

Usage

Result
Loading...
<>
  <Heading> Heading 1 </Heading>
  <Heading size="h2"> Heading 1 </Heading>
  <Heading size="h3"> Heading 2 </Heading>
  <Heading size="h3"> Heading 3 </Heading>
  <Heading size="h4"> Heading 4 </Heading>
  <Heading size="h5"> Heading 5 </Heading>
  <Heading size="h6"> Heading 6 </Heading>
</>

Changing the size of the heading does not change its html element type. It only changes the font size of the heading. If you want to change the html element type, you can use the as prop.

Result
Loading...
Live Editor
<Heading size="h5" as="h1">
  Heading 1
</Heading>

Props

PropertyDescriptionTypeDefault
sizefont size of the texth1 h2 h3 h4 h5 h6h1
weightfont weight of the textregular medium boldregular