Text Component

React Native 5 min min read Updated: Jul 26, 2026 Beginner
Text Component
Beginner Topic 2 of 30

Text Component

The Text component is the only way to display text content in React Native. Unlike the web, plain text cannot be placed directly inside a View without being wrapped in a Text component.

Basic Usage

javascript import { Text } from 'react-native'; Hello, World!

Styling Text

Text supports styling properties such as fontSize, fontWeight, color, and textAlign through the style prop.

javascript Styled Text

Nesting Text Components

Text components can be nested inside one another, allowing you to apply different styles to individual parts of a sentence.

javascript Hello, World!

Truncating Text

The numberOfLines prop limits the text to a specific number of lines, automatically truncating overflow with an ellipsis.

javascript This is a long piece of text that will be truncated after two lines...

Handling Text Press Events

Text components support an onPress event, making it possible to create tappable links or labels without wrapping them in a separate touchable component.

javascript console.log('Text pressed')}>Tap Me

Selectable Text

Setting the selectable prop to true allows users to long-press and copy text, which is useful for displaying content like error codes or reference numbers.

Conclusion

The Text component is essential for displaying any readable content in a React Native application. Understanding its styling options, nesting behavior, and event handling capabilities allows you to build clean and functional text-based interfaces.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators