Usage

Before you use Typography, a semantic component may be more appropriate.

Typography will always wrap children in a span. You can customize the tag it renders by using the as prop from styled-components. WARNING: If using TypeScript, it will not switch types and some props may error. You can add // @ts-expect-error. See styled-components issue.

Props

NameTypeRequiredDefaultDescription
as
string | ComponentType<any>
false
Change the HTML tag. This{' '} prop is from styled-components .WARNING: If using TypeScript, it will not switch types and some props may error. You can add // @ts-expect-error. See{' '} styled-components issue .
since

10.19.0

children
ReactNode
true
When children are a string or multiple elements, they will be wrapped by a span. When it is a single element, classnames will be added to it instead
since

10.19.0

className
string
false

Additional classNames

color
Color
false
Changes font color, can be any of the{' '} HSL Palette css strings
default

'gray15'

since

10.19.0

intentfalse

Changes the size of the font

since

10.19.0

italic
boolean
false

Applies font-style: italic if enabled

since

10.19.0

style
CSSProperties
false

Additional CSS styles

weightfalse

Changes font weight if it is supported in the design system

since

10.19.0

Italics

Please wrap the text you would like to make italic with an <em> or <i> tag.

The <em> tag is used to define emphasized text. The content inside is typically displayed in italic. A screen reader will pronounce the words in <em> with an emphasis, using verbal stress.

The <i> tag defines a part of text in an alternate voice or mood. The content inside is typically displayed in italic. The <i> tag is often used to indicate a technical term, a phrase from another language, a thought, a ship name, etc. Use the <i> element only when there is not a more appropriate semantic element.

Font Weight

Please wrap the text you would like to make bold with an <strong> or <b> tag, or pass the tag using the as prop. The strong tag has similar benefits to em, but calling out that this text is important opposed to emphasized. Read more from MDN.

Considerations

  • <em> (emphasized text)
  • <strong> (important text)
  • <mark> (marked/highlighted text)
  • <cite> (the title of a work)
  • <dfn> (a definition term)