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.

TextBlock

The text block component renders a block of text that occupies the full width available, similar to a paragraph. Use text block for multi-line content like descriptions, policies, or explanatory copy.

For inline text styling within a sentence, use Text.

Support
Targets (25)

Configure the following properties on the TextBlock component.

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

A unique identifier for the component. Use this to target the component in scripts or stylesheets, or to distinguish it from other instances of the same component.

Anchor to inlineAlignment
inlineAlignment

Align text along the main axis.

Size of the text


Anchor to Display a block of textDisplay a block of text

Render a full-width block of text content. This example displays a text block component as a paragraph.

Display a block of text

A text block component rendering a paragraph of text

Display a block of text

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

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

function Extension() {
return (
<BlockStack>
<TextBlock>
We have a 30-day return policy, which
means you have 30 days after receiving
your item to request a return.
</TextBlock>
<TextBlock>
To be eligible for a return, your item
must be in the same condition that you
received it, unworn or unused, with tags,
and in its original packaging. You’ll also
need the receipt or proof of purchase.
</TextBlock>
</BlockStack>
);
}
import {
extension,
TextBlock,
BlockStack,
} from '@shopify/ui-extensions/customer-account';

export default extension('customer-account.page.render', (root) => {
const textBlock = root.createComponent(BlockStack, undefined, [
root.createComponent(
TextBlock,
undefined,
'We have a 30-day return policy, which means you have 30 days after receiving your item to request a return.',
),
root.createComponent(
TextBlock,
undefined,
'To be eligible for a return, your item must be in the same condition that you received it, unworn or unused, with tags, and in its original packaging. You’ll also need the receipt or proof of purchase.',
),
]);

root.appendChild(textBlock);
});

  • Keep paragraphs focused: Limit each text block to a single idea for scannability.
  • Use appropriate size: Match the text size to the content hierarchy.
  • Use Text for inline styling: For emphasizing words within a text block, nest Text components inside.

Was this page helpful?