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 provides semantic value and visual styling for a small piece of text content. Use text to emphasize or differentiate words or phrases within paragraphs or other block-level components.

For block-level text that occupies full width, use TextBlock.

Support
Targets (25)

Configure the following properties on the Text component.

Anchor to accessibilityRole
accessibilityRole

Set the semantic of the component’s content

Anchor to accessibilityVisibility
accessibilityVisibility

The visibility of the element to assistive technologies.

Anchor to appearance
appearance
'subdued' | 'accent' | 'decorative' | 'info' | 'success' | 'warning' | 'critical'

Changes the visual appearance

Anchor to emphasis
emphasis

Use to emphasize a word or a group of words.

string

Unique identifier. Typically used as a target for another component’s controls to associate an accessible label with an action.

Size of the text

Anchor to visibility
visibility

The visual visibility of the element.


Apply visual styling to a small piece of inline text. This example renders a text component with default styling.

Style inline text

A text component styling inline text content

Style inline text

import {
reactExtension,
Text,
BlockStack,
} from '@shopify/ui-extensions-react/customer-account';

export default reactExtension(
'customer-account.page.render',
() => <Extension />,
);

function Extension() {
return (
<BlockStack inlineAlignment="center">
<Text size="extraSmall">Total</Text>
<Text size="small">Total</Text>
<Text size="base">Total</Text>
<Text size="medium">Total</Text>
<Text size="large">Total</Text>
<Text size="extraLarge">Total</Text>
</BlockStack>
);
}
import {extension, Text, BlockStack} from '@shopify/ui-extensions/customer-account';

export default extension('customer-account.page.render', (root) => {
const text = root.createComponent(BlockStack, undefined, [
root.createComponent(Text, {size: 'extraSmall'}, 'Total'),
root.createComponent(Text, {size: 'small'}, 'Total'),
root.createComponent(Text, {size: 'base'}, 'Total'),
root.createComponent(Text, {size: 'medium'}, 'Total'),
root.createComponent(Text, {size: 'large'}, 'Total'),
root.createComponent(Text, {size: 'extraLarge'}, 'Total'),
]);

root.appendChild(text);
});

  • Keep inline text short: Use text for words or phrases, not full paragraphs.
  • Apply styles intentionally: Use emphasis and tone to convey meaning, not decoration.
  • Use TextBlock for paragraphs: For block-level content, use TextBlock instead.

Was this page helpful?