Skip to main content

Migrate TextBlock to the Polaris paragraph component

The Polaris paragraph component renders block-level text content. It replaces the previous TextBlock component and is available as <s-paragraph> in API versions 2025-10 and newer.


The following properties are different in the Polaris paragraph component.

The previous TextBlock inlineAlignment prop is now called textAlign. The accepted values are unchanged.

Previous valueNew value
inlineAlignment="start"textAlign="start"
inlineAlignment="center"textAlign="center"
inlineAlignment="end"textAlign="end"

Migrating inlineAlignment to textAlign

import '@shopify/ui-extensions/preact';
import {render} from 'preact';

export default function extension() {
render(<Extension />, document.body);
}

function Extension() {
return (
<s-paragraph textAlign="end">Total: $99.99</s-paragraph>
);
}
import {
reactExtension,
TextBlock,
} from '@shopify/ui-extensions-react/checkout';

export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);

function Extension() {
return (
<TextBlock inlineAlignment="end">Total: $99.99</TextBlock>
);
}

The previous TextBlock size prop is now called type.

Previous valueNew valueMigration notes
'base''paragraph'Default type, can be omitted.
'small''small'Use type="small".

Migrating size to type

import '@shopify/ui-extensions/preact';
import {render} from 'preact';

export default function extension() {
render(<Extension />, document.body);
}

function Extension() {
return (
<s-paragraph type="small">
Fine print or disclaimer text
</s-paragraph>
);
}
import {
reactExtension,
TextBlock,
} from '@shopify/ui-extensions-react/checkout';

export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);

function Extension() {
return (
<TextBlock size="small">
Fine print or disclaimer text
</TextBlock>
);
}

The Polaris paragraph component no longer supports appearance. Use color and tone instead.

Previous valueNew patternMigration notes
'subdued'color="subdued"Use color prop.
'info'tone="info"Use tone prop.
'success'tone="success"Use tone prop.
'warning'tone="warning"Use tone prop.
'critical'tone="critical"Use tone prop.
'decorative'tone="custom"Use tone="custom".
'accent'RemovedInteractive elements like <s-link> are styled with the accent treatment automatically.

Migrating appearance to color and tone

import '@shopify/ui-extensions/preact';
import {render} from 'preact';

export default function extension() {
render(<Extension />, document.body);
}

function Extension() {
return (
<>
<s-paragraph color="subdued">
Secondary information
</s-paragraph>
<s-paragraph tone="success">
Your order was successful
</s-paragraph>
</>
);
}
import {
reactExtension,
TextBlock,
} from '@shopify/ui-extensions-react/checkout';

export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);

function Extension() {
return (
<>
<TextBlock appearance="subdued">
Secondary information
</TextBlock>
<TextBlock appearance="success">
Your order was successful
</TextBlock>
</>
);
}

The Polaris paragraph component no longer supports emphasis directly. Wrap content in <s-text> with the appropriate type to apply emphasis.

Previous valueNew pattern
emphasis="bold"Wrap in <s-text type="strong">
emphasis="italic"Wrap in <s-text type="offset">

Migrating emphasis

import '@shopify/ui-extensions/preact';
import {render} from 'preact';

export default function extension() {
render(<Extension />, document.body);
}

function Extension() {
return (
<s-paragraph>
<s-text type="strong">Important information</s-text>
</s-paragraph>
);
}
import {
reactExtension,
TextBlock,
} from '@shopify/ui-extensions-react/checkout';

export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);

function Extension() {
return (
<TextBlock emphasis="bold">
Important information
</TextBlock>
);
}

The Polaris paragraph component introduces the following new properties:

New propTypeDescription
color'subdued' | 'base'Text color.
tone'auto' | 'info' | 'success' | 'warning' | 'critical' | 'custom'Semantic tone.
accessibilityVisibility'visible' | 'hidden' | 'exclusive'Controls visibility for assistive technologies.
dir'ltr' | 'rtl' | 'auto'Text direction.
langstringLanguage of the content.

Was this page helpful?