Skip to main content

Text

Text

It's never been easier to write and style text. We're using a helper function to normalize the text so that it could look good on any kind of device.

Text

Usage

Imports:

import { Text } from 'galio-framework';

Basic examples:

<Text h1>Heading 1</Text>
<Text h2>Heading 2</Text>
<Text h3>Heading 3</Text>
<Text h4>Heading 4</Text>
<Text h5>Heading 5</Text>
<Text p>Paragraph</Text>
<Text muted>This is a muted paragraph.</Text>

Advanced examples:

<Text 
h1
color="primary"
bold
style={{ textAlign: 'center' }}
>
Custom Styled Heading
</Text>

<Text
p
muted
italic
size={18}
style={{ lineHeight: 24 }}
>
Custom paragraph with specific styling
</Text>

Props

PropTypeDefaultDescription
h1boolfalseSets the text's fontSize to 44px
h2boolfalseSets the text's fontSize to 38px
h3boolfalseSets the text's fontSize to 30px
h4boolfalseSets the text's fontSize to 24px
h5boolfalseSets the text's fontSize to 18px
pboolfalseSets the text's fontSize to 16px
sizenumber0Sets the fontSize of the text
colorstringnullSets the color of the text
mutedboolfalseChanges the text color to theme.COLORS.MUTED
boldboolfalseSets the fontWeight to 'bold'
italicboolfalseSets the fontStyle to 'italic'
centerboolfalseCenters the text
leftboolfalseLeft aligns the text
rightboolfalseRight aligns the text
styleobjectnullCustom styles
...Text.props--All React Native Text props are supported