Migrate to the Polaris text component
The Polaris text component renders inline text with semantic meaning and styling. It replaces the previous Text component and is available as <s-text> in API versions 2025-10 and newer.
Anchor to Updated propertiesUpdated properties
The following properties are different in the Polaris text component.
Anchor to emphasisemphasis
The previous Text emphasis prop is now called type.
| Previous value | New value | Migration notes |
|---|---|---|
'bold' | type="strong" | Use type="strong". |
'italic' | type="offset" | Use type="offset". |
Migrating emphasis to type
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return <s-text type="strong">Total: $99.99</s-text>;
}Pre-Polaris (2025-07)
import {
reactExtension,
Text,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return <Text emphasis="bold">Total: $99.99</Text>;
}Anchor to accessibilityRoleaccessibility Role
The previous Text accessibilityRole prop has been replaced with type for string roles, and separate components for object roles.
String roles:
| Previous role | New pattern |
|---|---|
'address' | type="address" |
'deletion' | type="redundant" |
'marking' | type="mark" |
'offset' | type="offset" |
'stress' | type="offset" |
'strong' | type="strong" |
Object roles:
| Previous pattern | New pattern |
|---|---|
accessibilityRole={{type: 'abbreviation', for: '...'}} | Use <s-abbreviation title="..."> |
accessibilityRole={{type: 'datetime', machineReadable: '...'}} | Use <s-time dateTime="..."> |
accessibilityRole={{type: 'directional-override', direction: '...'}} | Use dir prop on <s-text> |
Migrating accessibilityRole (string)
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return (
<s-text type="address">
123 Main St, Toronto, ON
</s-text>
);
}Pre-Polaris (2025-07)
import {
reactExtension,
Text,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return (
<Text accessibilityRole="address">
123 Main St, Toronto, ON
</Text>
);
}Migrating accessibilityRole (object)
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return (
<>
<s-abbreviation title="Hypertext Markup Language">
HTML
</s-abbreviation>
<s-time dateTime="2024-01-15">January 15, 2024</s-time>
<s-text dir="rtl">שלום</s-text>
</>
);
}Pre-Polaris (2025-07)
import {
reactExtension,
Text,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return (
<>
<Text
accessibilityRole={{
type: 'abbreviation',
for: 'Hypertext Markup Language',
}}
>
HTML
</Text>
<Text
accessibilityRole={{
type: 'datetime',
machineReadable: '2024-01-15',
}}
>
January 15, 2024
</Text>
<Text
accessibilityRole={{
type: 'directional-override',
direction: 'rtl',
}}
>
שלום
</Text>
</>
);
}Anchor to visibilityvisibility
The previous visibility="hidden" is now accessibilityVisibility="exclusive".
| Previous pattern | New pattern |
|---|---|
visibility="hidden" | accessibilityVisibility="exclusive" |
Anchor to Removed propertiesRemoved properties
Anchor to appearanceappearance
The Polaris text component no longer supports appearance. Use color and tone instead.
| Previous value | New pattern | Migration 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' | tone="auto" | Use tone="auto". |
Migrating appearance to color and tone
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return (
<>
<s-text color="subdued">Optional</s-text>
<s-text tone="critical">Payment failed</s-text>
</>
);
}Pre-Polaris (2025-07)
import {
reactExtension,
Text,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return (
<>
<Text appearance="subdued">Optional</Text>
<Text appearance="critical">Payment failed</Text>
</>
);
}Anchor to sizesize
The Polaris text component no longer supports size. Use type="small" for small text, or <s-heading> for larger text.
Anchor to New propertiesNew properties
The Polaris text component introduces the following new properties:
| New prop | Type | Description |
|---|---|---|
color | 'subdued' | 'base' | Text color. |
dir | 'ltr' | 'rtl' | 'auto' | Text direction. |
display | 'auto' | 'none' | Controls element visibility. |
lang | string | Language of the text content. |
tone | 'auto' | 'info' | 'success' | 'warning' | 'critical' | 'custom' | Semantic tone. |