npx gluestack-ui add textimport { Text } from '@/components/ui/text';
export default () => <Text />;
Renders a <span /> on web and a Text on native.
| Platform | Output |
|---|---|
Web | <span /> |
Native | <Text /> |
| Name | Value | Default |
|---|---|---|
isTruncated | true | false |
bold | true | false |
underline | true | false |
strikeThrough | true | false |
sub | true | false |
italic | true | false |
highlight | true | false |
size | 2xs | xs | sm | md | lg | xl | 2xl | 3xl | 4xl | 5xl | 6xl | md |
| Prop | Type | Default | Description |
|---|---|---|---|
bold | boolean | false | Used to make the text bold. |
isTruncated | boolean | false | If true, it will render an ellipsis when the text exceeds the width of the viewport or maxWidth set. |
italic | boolean | false | Used to make the text italic. |
underline | boolean | false | Used underline the text. |
strikeThrough | boolean | false | A horizontal line through the center of the text. |
highlight | boolean | false | Used to highlight the text with a yellow background. |