gluestack-ui logo
Get Updates
Prompt to React Native UI
Home
Components
Hooks
Apps
MCP Server
Guides
Home
Overview
IntroductionQuick Start
Getting Started
InstallationTooling SetupVS Code ExtensionsFigma UI KitCLIgluestack-ui-nativewind-utils
Core Concepts
AccessibilityUniversal
Performance
Benchmarks
Theme Configuration
Default TokensCustomizing ThemeDark Mode
Components
All Components
Typography
HeadingrscTextrsc
Layout
BoxrscCenterrscDividerHStackrscVStackrscGridalpha, rsc
Feedback
AlertProgressSpinnerToast
Data Display
BadgeCardrscTablealpha
Forms
ButtonCheckboxFormControlInputLinkPressableRadioSelectSliderSwitchTextarea
Overlay
AlertDialogDrawerMenuModalPopoverPortalTooltip
Disclosure
ActionsheetAccordionBottomSheetalpha
Media And Icons
AvatarImageIconrsc
Others
FabSkeletonalpha, rsc
Hooks
useBreakPointValue
useMediaQuery
Apps
Dashboard App
Kitchensink App
Todo App
Starter Kit
MCP Server
MCP Server
Guides
Recipes
LinearGradient
Tutorials
Building Ecommerce App
More
Upgrade to v2Upgrade to v3FAQsReleasesRoadmapTroubleshootingDiscord FAQs

Text

Enhance your app with gluestack-ui's Text component—an adaptable React Native text area with multiple styles, sizes, and formatting options for seamless UI design. This is an illustration of Text component.

Installation

Run the following command:

npx gluestack-ui add text

API Reference

To use this component in your project, include the following import statement in your file.
import { Text } from '@/components/ui/text';
export default () => <Text />;

Component Props

This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.

Text

Renders a <span /> on web and a Text on native.

PlatformOutput
Web
<span />
Native
<Text />

Props

Text component is created using
Text
component from react-native on native and
span
html element on web. It accepts the following props:

Text

NameValueDefault
isTruncated
truefalse
bold
truefalse
underline
truefalse
strikeThrough
truefalse
sub
truefalse
italic
truefalse
highlight
truefalse
size
2xs | xs | sm | md | lg | xl | 2xl | 3xl | 4xl | 5xl | 6xlmd

Examples

The Examples section provides visual representations of the different variants of the component, allowing you to quickly and easily determine which one best fits your needs. Simply copy the code and integrate it into your project.

Text Sizes

Text component comes in different sizes, such as
xs
,
sm
,
md
,
lg
,
xl
,
2xl
,
3xl
,
4xl
,
5xl
, and
6xl
allowing users to adjust the button size based on their design needs.
Text component also accepts some shorthands for basic quick styling.
PropTypeDefaultDescription
bold
booleanfalseUsed to make the text bold.
isTruncated
booleanfalseIf true, it will render an ellipsis when the text exceeds the width of the viewport or maxWidth set.
italic
booleanfalseUsed to make the text italic.
underline
booleanfalseUsed underline the text.
strikeThrough
booleanfalseA horizontal line through the center of the text.
highlight
booleanfalseUsed to highlight the text with a yellow background.
Edit this page on GitHub
Go backHeading
Up nextBox
Go backHeading
Up nextBox