Skip to main content

Text

Use these utility props and classes to override the text style of an element.

Props

Variant

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5

Heading 6

Subtitle

Body

Caption

Overline

<Text variant="h1">Heading 1</Text>
<Text variant="h2">Heading 2</Text>
<Text variant="h3">Heading 3</Text>
<Text variant="h4">Heading 4</Text>
<Text variant="h5">Heading 5</Text>
<Text variant="h6">Heading 6</Text>

<Text variant="subtitle">Subtitle</Text>
<Text variant="body">Body</Text>
<Text variant="caption">Caption</Text>
<Text variant="overline">Overline</Text>
This prop is only related to styling

In order to use the correct semantic component, you need to combine it with the component prop (for pallote-react) or use the correct HTML tag (for pallote-css).

Component

h1

h2

h3

h4

h5
h6

p (default)

spanlegend
<Text component="h1">h1</Text>
<Text component="h2">h2</Text>
<Text component="h3">h3</Text>
<Text component="h4">h4</Text>
<Text component="h5">h5</Text>
<Text component="h6">h6</Text>

<Text component="p">p (default)</Text>
<Text component="span">span</Text>
<Text component="label">label</Text>
<Text component="legend">legend</Text>

Align

Align left and rub whiskers on bare skin act innocent. Catto munch salmono while happily ignoring when being called terrorize the hundred-and-twenty-pound rottweiler and steal his bed, not sorry eat from dog's food.

Align center and stare at ceiling cough hairball on conveniently placed pants and break lamps and curl up into a ball, so get scared by sudden appearance of cucumber hack step on your keyboard while you're gaming and then turn in a circle.

Align right lick master's hand at first then bite because im moody chew the plant scratch my tummy actually i hate you now fight me. Sun bathe steal the warm chair right after you get up.

Align justify meow in empty rooms mew mew. I love cats i am one wake up scratch humans leg for food then purr then i have a and relax lick master's hand at first then bite because im moody dismember a mouse and then regurgitate parts of it on the family room floor.

<Text align="left">Left{/* content */}</Text>
<Text align="center">Center{/* content */}</Text>
<Text align="right">Right{/* content */}</Text>
<Text align="justify">Justify{/* content */}</Text>

Weight

Regular

Bold

<Text weight="regular">Regular</Text>
<Text weight="bold">Bold</Text>

Transform

None

Capitalize

Uppercase

Lowercase

Initial

Inherit

<Text transform="none">None</Text>
<Text transform="capitalize">Capitalize</Text>
<Text transform="uppercase">Uppercase</Text>
<Text transform="lowercase">Lowercase</Text>
<Text transform="initial">Initial</Text>
<Text transform="inherit">Inherit</Text>

Italic

Italic

<Text italic>Italic</Text>

Underline

Underline

<Text underline>Underline</Text>

StrikeThrough

StrikeThrough

<Text strikeThrough>StrikeThrough</Text>

Code

Code

<Text code>Code</Text>

Color

Default

Alt

Disabled

Contrast

Contrast alt

Contrast disabled

Primary

Secondary

Success

Info

Warning

Error

<Text color="default">Default</Text>
<Text color="alt">Alt</Text>
<Text color="disabled">Disabled</Text>

<Text color="contrast">Contrast</Text>
<Text color="contrastAlt">Contrast alt</Text>
<Text color="contrastDisabled">Contrast disabled</Text>

<Text color="primary">Primary</Text>
<Text color="secondary">Secondary</Text>

<Text color="success">Success</Text>
<Text color="info">Info</Text>
<Text color="warning">Warning</Text>
<Text color="error">Error</Text>

Props details

PropValuesDefault
varianth1 h2 h3 h4 h5 h6
subtitle body caption overline
body
componenth1 h2 h3 h4 h5 h6
p span label legend
p
alignleft center right justifyleft
weightregular boldregular
transformnone capitalize uppercase lowercase initial inherit
underlineboolfalse
italicboolfalse
codeboolfalse
colordefault alt disabled
contrast contrastAlt contrastDisabled
primary secondary
success info warning error
default

Examples

Be mindful of text sizes

And colour contrast

When writing content
<Text variant="h4" component="h3" underline>Be mindful of text sizes</Text>
<Text variant="caption" italic color="success">And colour contrast</Text>
<Text variant="body" component="span" weight="bold">When writing content</Text>