Import
Basic Usage
Props
Content Props
The text content to display.
Styling Props
Text styling including font properties, color, and text decoration. Supports all text-specific style properties.
Display Props
Used to truncate the text with an ellipsis after computing the text layout, including line wrapping, such that the total number of lines does not exceed this number.
When
numberOfLines is set, this prop defines how text will be truncated.head- The line is displayed so that the end fits in the container and the missing text at the beginning is indicated by an ellipsis. e.g., “…wxyz”middle- The line is displayed so that the beginning and end fit in the container and the missing text in the middle is indicated by an ellipsis. “ab…yz”tail- The line is displayed so that the beginning fits in the container and the missing text at the end is indicated by an ellipsis. e.g., “abcd…”clip- Lines are not drawn past the edge of the text container (iOS only)
Font Props
Whether fonts should scale to respect Text Size accessibility settings.
Specifies largest possible scale a font can reach when
allowFontScaling is enabled.null/undefined(default): inherit from the parent node or the global default (0)0: no max, ignore parent/global default>= 1: sets the maxFontSizeMultiplier of this node to this value
Interaction Props
Lets the user select text, to use the native copy and paste functionality.
This function is called on press. Text intrinsically supports press handling with a default highlight state.
This function is called on long press.
Defines how far your touch may move off of the button, before deactivating the button.
Specifies the disabled state of the text view for testing purposes.
Identification Props
Used to reference react managed views from native code.
Used to locate this view from native code.
Used to locate this view in end-to-end tests.
Event Handlers
Invoked on mount and layout changes with
{nativeEvent: { layout: {x, y, width, height}}}.Called when the text layout changes.
Platform-Specific Props
- iOS
- Android
Specifies whether font should be scaled down automatically to fit given style constraints.
When true, no visual change is made when text is pressed down. By default, a gray oval highlights the text on press down.
Set line break strategy on iOS.
The Dynamic Type scale ramp to apply to this element on iOS. Options include: ‘caption2’, ‘caption1’, ‘footnote’, ‘subheadline’, ‘callout’, ‘body’, ‘headline’, ‘title3’, ‘title2’, ‘title1’, ‘largeTitle’.