Skip to main content

Text

A Text component contains TextHeader and TextBody child components that use a Text component that will accept a format, such as markdown. The Text component uses the raw text and format passed in to parse it into HTML. This is primarily used in CMS generated content.

Example

Heading Text

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Bulleted List

  • First set
  • Second set
  • Third set
  • Fourth set

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Variants

Use theicon above to preview
VariantDescriptionValues
headerTextPositionText alignment of the header
  • Left
  • Right
  • Center
headerPaddingAmount of padding below the header.
  • Regular
  • Extra
bodyTextPositionText alignment of the body text
  • Left
  • Right
  • Center
fullBleedWidth of the text is flush left and right or has side padding
  • True
  • False
backgroundOptional background color; default is transparentColor picker value
paddingTopOption to control spacing above the component
  • Regular
  • Extra
paddingBottomOption to control spacing below the component
  • Regular
  • Extra

Customization

Approach for customization will vary depending on if the customization is intended to be global for all consumers of the ui component or if it is only an override for a particular instance.

  • If the customization is necessary for all use cases, update the component source code of in the ui library package directly.
  • Otherwise, pass className overrides.

Say you wanted to make the header text larger in one particular instance:

<TextWrapper>
<TextContent>
<TextHeader className='text-6xl'>
<Text text={headerText} id={id} type={type} format={format} />
</TextHeader>
...
</TextContent>
</TextWrapper>