gluestack-ui logopreview
Docs
Blog
Get Updates
Prompt to React Native
IntroductionQuick Start
InstallationTooling SetupVS Code ExtensionsFigma UI KitCLIgluestack-ui-nativewind-utils
AccessibilityUniversal
Benchmarks
Default TokensCustomizing ThemeDark Mode
All Components
HeadingrscTextrsc
BoxrscCenterrscDividerHStackrscVStackrscGridalpha, rsc
AlertProgressSpinnerToast
BadgeCardrscTablealphaTabsalpha
ButtonCheckboxDateTimePickerCalendarFormControlInputLinkPressableRadioSelectSliderSwitchTextarea
AlertDialogDrawerLiquid GlassMenuModalPopoverPortalTooltipImage Viewer
ActionsheetAccordionBottomSheetalpha
AvatarImageIconrsc
FabSkeletonalpha, rsc
useBreakPointValueuseMediaQuery
Dashboard AppKitchensink AppTodo AppStarter KitAppLighter
LinearGradient
Building Ecommerce App
Upgrade to v2Upgrade to v3Upgrade to v4FAQsReleasesChangelogRoadmapTroubleshootingDiscord 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@alpha 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