Heading
Notes
A component for marking up page headings. Provide the component a tagName
appropriate for the
current document outline, and a standardized size
.
Additional visual styling can be accomplished by passing in text-*
utility classes.
By separating the visual style and HTML element of heading elements, we can ensure that pages have appropriate, accessible document outlines without having to worry about changing visuals.
For more information, see Managing Typography on Large Apps and Abandoning Global Heading Styles.
Props
- bottomBorder
bool
- children
node
- className
string
- elementRef
func
- size
oneOf('xxl', 'xl', 'lg', 'md', 'sm', 'xs', 'xxs')
These map to standard
text-*
utility classes. An alternative to the size prop is to specify atext-*
className, but headings will likely evolve to include refined letter-spacing and line-height per size, so it's best to stick with the size props. - tagName
any
*The HTML tagName or React component to be rendered. This should almost always be an
h1
–h6
element that forms a correct document outline.
Example: Heading Size XL
Heading Size XL details
- Size
headingSizeXl
- REM
3.1 (31px)
Example: Heading Size Lg
Heading Size Lg details
- Size
headingSizeLg
- REM
2.6 (26px)
- Modifiers
Bold
Example: Heading Size Md
Heading Size Md details
- Size
headingSizeMd
- REM
2.2 (22px)
Example: Heading Size Sm
Heading Size Sm details
- Size
headingSizeSm
- REM
1.9 (19px)
Example: Heading Size Xs
Heading Size Xs details
- Size
headingSizeXs
- REM
1.7 (17px)
- Modifiers
Bold
Example: Heading Size Xxs
Heading Size Xxs details
- Size
headingSizeXxs
- REM
1.4 (14px)
- Modifiers
Uppercase & Bold