Code

The Text component usage and API reference.

This is a compound component, but with no wrapper.

API

The following table includes the props that all types of Text subcomponentscan have.

Props
Type
Required

children

ReactNode

typeset

'mouse' | 'sm-caps' | 'body' | 'body-lg' | 'heading-2' | 'heading-1' | 'title-2' | 'title-1';

align

'left' | 'center' | 'right' | 'justify'

variants

'base' | 'primary' | 'danger' | 'warning' | 'success' | 'subtle' | 'inverted' | 'invertedSubtle';

children

The structure that will be rendered inside the wrapper.

typeset

Sets the pre-formated style for the text. 'body' is the default value.

align

Sets the alignment for the text

variants

Sets the pre-formated variant style for the text.

H1, H2, H3, H4, H5, H6

This subcomponents extend the native <hx> props.

P, SPAN

This subcomponents extend the native <p> and <span> props respectively.

Example

Live Demo

Last updated