Text

Live example


Implementation

Margins

Typography uses responsive margins, with 12px and 8px being the default sizes on small screens. Headings each have their own top margin, based on their size, to help the content read better. This also clarifies the content hierarchy. These spacings are factored into the components.

There are exceptions to these rules as follows:

  • To ensure that everything lines up, the margin from the top of the first typography component, and the margin bottom from the last have been removed.
  • Headings that are immediately next to each other should use the default gap of 12px (or 8 on small screens) only.

Superscript in ReactNative

  1. Creating these elements in react native is more trouble than it's worth, instead use the HTML entities for these characters: 
    https://www.toptal.com/designers/htmlarrows/math/superscript-one/

Properties

P

Name

Values

Default

size

'sm' | 'md' | 'lg' | 'xl'

‘md'

inverted

boolean

children

ReactNode

 

align 5.22.0+

'left' | 'center' | 'right'

 

...

JSX.IntrinsicElements["p"]

 

<P>Strong</P>

Name

Values

Default

children

ReactNode

 

...

JSX.IntrinsicElements["strong"]

 

<P>Em</P>

Name

Values

Default

children

ReactNode

 

...

JSX.IntrinsicElements["em"]

 

<P>Sup</P>

Name

Values

Default

children

ReactNode

 

...

JSX.IntrinsicElements["sup"]

 

<P>Sub</P>

Name

Values

Default

children

ReactNode

 

...

JSX.IntrinsicElements["sub"]

 

<P>LineThrough</P>

Name

Values

Default

children

ReactNode

 

...

JSX.IntrinsicElements["span"]

 

NativeProperties

P

Name

Values

Default

size

'sm' | 'md' | 'lg' | 'xl'

‘md'

inverted

boolean

false

align 5.26.0+

'left' | 'center' | 'right'

 

…

PropsWithChildren<TextProps>

 

<P>Strong | Em | LineThrough</P>

Name

Values

Default

children

ReactNode