# Text

Text component provides a simple element to avoid dealing with sizing in the React Native Text.

![](https://1974771079-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LK6D3dfAKckmlwkiENO%2F-MGmdhd73qWg_lPPzHFf%2F-MGxElGp5DDWI-NgT7fX%2FSimulator%20Screen%20Shot%20-%20iPhone%2011%20-%202020-09-08%20at%2012.30.45.png?alt=media\&token=d3b012f5-e835-4b69-8bb5-d1a51934ccb3)

```jsx
import { Text } from '../components/';

<Text component="h1">Default text</Text>
<Text component="h2">Default text</Text>
<Text component="h3">Default text</Text>
<Text component="h4">Default text</Text>
<Text component="h5">Default text</Text>
<Text component="h6">Default text</Text>
<Text component="s1">Default text</Text>
<Text component="s2">Default text</Text>
<Text component="p1">Default text</Text>
<Text component="p2">Default text</Text>
<Text component="c1">Default text</Text>
<Text component="c2">Default text</Text>
<Text component="label">Default text</Text>
```

## Properties

| Name         | Type                                   | Description                                                                                                                                                                                                                                                                                                                                             |
| ------------ | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| children     | `ReactText \| ReactElement<TextProps>` | String or number to be rendered as text. Also can be ReactElement - nested Text component.                                                                                                                                                                                                                                                              |
| component    | `string`                               | Can be `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `s1`, `s2`, `p1`, `p2`, `c1`, `c2`, `label`. Defaults to *p1*. Use *h* categories when needed to display headings. Use *s* categories when needed to display subtitles. Use *p* categories when needed to display regular text. Use *c* and *label* categories when needed to give user a hint on something. |
| ...TextProps | `TextProps`                            | Any props applied to Text component.                                                                                                                                                                                                                                                                                                                    |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.reactnativestarter.com/components/text.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
