Typography styles are used throughout the UI. If used consistently they will help you maintain a hierarchy that is clear to your users.
Usage
import { HeadingText } from 'nr1'
Examples
Basic
<> <HeadingText>Heading 4 (default)</HeadingText></>
Basic
<> <HeadingText type={HeadingText.TYPE.HEADING_1}>Heading 1</HeadingText> <HeadingText type={HeadingText.TYPE.HEADING_2}>Heading 2</HeadingText> <HeadingText type={HeadingText.TYPE.HEADING_3}>Heading 3</HeadingText> <HeadingText type={HeadingText.TYPE.HEADING_4}>Heading 4</HeadingText> <HeadingText type={HeadingText.TYPE.HEADING_5}>Heading 5</HeadingText> <HeadingText type={HeadingText.TYPE.HEADING_6}>Heading 6</HeadingText></>
Changing semantic
<HeadingText type={HeadingText.TYPE.HEADING_1} tagType={HeadingText.TAG_TYPE.DIV}> This is a div element styled as a h1</HeadingText>
Props
node | Text to display. |
string | Appends class names to the component. Should be used only for positioning and spacing purposes. |
enum[] | Spacing property. Spacing is defined as a tuple of zero to four values, which follow the same conventions as CSS properties like <Array of |
object | Inline style for custom styling.Should be used only for positioning and spacing purposes. |
enum | Tag in which to wrap the text.Useful for changing the semantic meaning of the text. This does not apply any style. <One of |
string | Adds a Note: You might not see |
enum | Type of text that you want to display.This applies styles according to the type. <One of |