The Text component in React Native is used to display text on the screen. It supports styling, nesting, touch handling, and accessibility features, making it the foundation for showing readable content in mobile applications.
<Text> componentThe Text component behaves differently than HTML text. It does not allow raw strings outside Text and supports inline nesting for mixed styles.
// Basic Text component syntax
import { Text } from 'react-native';
<Text>Hello World</Text>
// Styled text with custom font size and color
import { Text, StyleSheet } from 'react-native';
<Text style={styles.title}>Welcome to React Native</Text>
const styles = StyleSheet.create({
title: {
fontSize: 24,
color: 'blue'
}
});
The text appears in blue color with a larger font size, styled using the StyleSheet API.
Explore React Native Text Props by toggling options below. This simulates how props change the UI and code.
React Native Text supports nesting, styling, and touch handling. This is a longer paragraph designed to demonstrate how text truncation works when you restrict the number of lines.