Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

Text

The Text component displays text with specific visual styles and colors. Use it to present content with appropriate typography hierarchy and semantic coloring for different types of information.

Text provides a comprehensive typography system that ensures consistent styling and proper visual hierarchy across POS interfaces.

Text components ensure proper text rendering across different device types and screen sizes while maintaining readability through appropriate line heights, letter spacing, and color contrast ratios. The component automatically adjusts line length for optimal readability based on container width, preventing overly long lines that reduce reading speed and comprehension in wider layouts.


Configure the following properties on the Text component.

Anchor to color
color

The semantic color of the text that conveys meaning and intent through visual styling.

Anchor to variant
variant

The typography variant that determines the size, weight, and styling of the text within the design system hierarchy.


Anchor to Display text with visual hierarchyDisplay text with visual hierarchy

Show text with appropriate typography styles and semantic coloring. This example demonstrates different text variants and colors to create visual hierarchy, ensuring consistent styling and proper readability across different device types and screen sizes.

Display text with visual hierarchy

Show text with appropriate typography styles and semantic coloring. This example demonstrates different text variants and colors to create visual hierarchy, ensuring consistent styling and proper readability across different device types and screen sizes.

Display text with visual hierarchy

import React from 'react';

import { Screen, reactExtension, Text, ScrollView } from '@shopify/ui-extensions-react/point-of-sale';

const SmartGridModal = () => {
return (
<Screen name='text' title='Text'>
<ScrollView>
<Text variant="body">body</Text>
<Text variant="captionMedium">captionMedium</Text>
<Text variant="captionRegular">captionRegular</Text>
<Text variant="captionRegularTall">captionRegularTall</Text>
<Text variant="display">display</Text>
<Text variant="headingLarge">headingLarge</Text>
<Text variant="headingSmall">headingSmall</Text>
<Text variant="sectionHeader">sectionHeader</Text>
<Text variant="headingSmall" color="TextCritical">
TextCritical
</Text>
<Text variant="headingSmall" color="TextDisabled">
TextDisabled
</Text>
<Text variant="headingSmall" color="TextHighlight">
TextHighlight
</Text>
<Text variant="headingSmall" color="TextInteractive">
TextInteractive
</Text>
<Text variant="headingSmall" color="TextNeutral">
TextNeutral
</Text>
<Text variant="headingSmall" color="TextSubdued">
TextSubdued
</Text>
<Text variant="headingSmall" color="TextSuccess">
TextSuccess
</Text>
<Text variant="headingSmall" color="TextWarning">
TextWarning
</Text>
</ScrollView>
</Screen>
);
}

export default reactExtension('pos.home.modal.render', () => {
return <SmartGridModal />
})
import {
extension,
Screen,
ScrollView,
Text,
} from '@shopify/ui-extensions/point-of-sale';

export default extension(
'pos.home.modal.render',
(root) => {
const mainScreen = root.createComponent(
Screen,
{name: 'text', title: 'Text'},
);
const scrollView =
root.createComponent(ScrollView);

scrollView.append(
root.createComponent(
Text,
{variant: 'body'},
'body',
),
);
scrollView.append(
root.createComponent(
Text,
{variant: 'captionMedium'},
'captionMedium',
),
);
scrollView.append(
root.createComponent(
Text,
{variant: 'captionRegular'},
'captionRegular',

  • Apply semantic colors to convey meaning: Use color to communicate the nature and intent of your content. Apply TextSuccess for positive outcomes, TextCritical for errors, TextWarning for cautions, and TextInteractive for clickable elements.
  • Maintain consistent typography patterns: Establish consistent patterns for how you use text variants across your POS UI extension. Similar types of content should use similar variants, helping users develop familiarity with your interface hierarchy.
  • Use subdued colors strategically: Apply TextSubdued for secondary information that supports but doesn't compete with primary content. Use TextDisabled only for truly inactive content that users can't interact with.
  • Balance emphasis with clarity: Use highlighting and interactive colors sparingly to maintain their effectiveness. Too many emphasized elements can reduce the impact of truly important content.

  • Text content is provided through child components rather than direct text properties—organize your text content through component composition.
  • Typography and color options are limited to the predefined design system variants—custom fonts, sizes, or colors beyond the available options aren't supported.
  • Complex rich text formatting requires multiple Text components with different variants and colors rather than inline formatting options.

Was this page helpful?