Migrate to the Polaris badge component
The Polaris badge component displays status information or indicates completed actions through compact visual indicators. It replaces the previous Badge component and is available as <s-badge> in API versions 2025-10 and newer.
Anchor to Updated propertiesUpdated properties
The following properties are different in the Polaris badge component.
Anchor to tonetone
Update tone values as follows:
| Previous value | New value |
|---|---|
'critical' | 'critical' |
'default' | 'auto' |
'subdued' | 'auto' + color="subdued" |
Migrating tone values
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return <s-badge color="subdued">Low stock</s-badge>;
}Pre-Polaris (2025-07)
import {
reactExtension,
Badge,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return <Badge tone="subdued">Low stock</Badge>;
}Anchor to sizesize
The size property adds a new option:
| Previous value | New value | Migration notes |
|---|---|---|
'small' | 'small' or 'small-100' | 'small' is an alias for 'small-100'. |
'base' | 'base' | No change is needed. |
For more on the scale system, see Scale.
Anchor to iconicon
If you use the icon property, then update icon names to their Polaris web component equivalents. Badge uses the same icon names as the Polaris icon component.
This table lists only icon values that need more than a camelCase-to-kebab-case rename. If an icon isn't listed here, then convert its previous camelCase name to kebab-case. For example, arrowLeft becomes arrow-left.
This table lists only icon values that need more than a camelCase-to-kebab-case rename. If an icon isn't listed here, then convert its previous camelCase name to kebab-case. For example, arrowLeft becomes arrow-left.
| Previous icon | New icon |
|---|---|
'checkmark' | 'check' |
'close' | 'x' |
'critical' | 'alert-circle' |
'error' | 'x-circle' |
'errorFill' | 'x-circle-filled' |
'gift' | 'gift-card' |
'giftFill' | 'gift-card' |
'hamburger' | 'menu' |
'hollowCircle' | 'circle' |
'horizontalDots' | 'menu-horizontal' |
'infoFill' | 'info-filled' |
'list' | 'list-bulleted' |
'magnify' | 'search' |
'marker' | 'location' |
'orderBox' | 'order' |
'pen' | 'edit' |
'question' | 'question-circle' |
'questionFill' | 'question-circle-filled' |
'starFill' | 'star-filled' |
'success' | 'check-circle' |
'verticalDots' | 'menu-vertical' |
'warning' | 'alert-triangle' |
'warningFill' | 'alert-triangle-filled' |
Migrating icon values
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return <s-badge icon="check">Fulfilled</s-badge>;
}Pre-Polaris (2025-07)
import {
reactExtension,
Badge,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return <Badge icon="checkmark">Fulfilled</Badge>;
}Anchor to Removed propertiesRemoved properties
Anchor to accessibilityLabelaccessibility Label
The Polaris badge component no longer supports accessibilityLabel directly. To provide an accessibility label, wrap the badge in s-box and set accessibilityLabel on the box.
Migrating accessibilityLabel
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return (
<s-box accessibilityLabel="Order fulfilled">
<s-badge>Fulfilled</s-badge>
</s-box>
);
}Pre-Polaris (2025-07)
import {
reactExtension,
Badge,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return <Badge accessibilityLabel="Order fulfilled">Fulfilled</Badge>;
}Anchor to accessibilityVisibilityaccessibility Visibility
The Polaris badge component no longer supports accessibilityVisibility directly. To control accessibility visibility, wrap the badge in s-box and set accessibilityVisibility on the box.
Use these values as needed:
visible: the element is visible to all users.hidden: the element is removed from the accessibility tree but remains visible.exclusive: the element is visually hidden but remains in the accessibility tree.
Migrating accessibilityVisibility
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return (
<s-box accessibilityVisibility="hidden">
<s-badge>Fulfilled</s-badge>
</s-box>
);
}Pre-Polaris (2025-07)
import {
reactExtension,
Badge,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return <Badge accessibilityVisibility="hidden">Fulfilled</Badge>;
}Anchor to visibilityvisibility
The Polaris badge component no longer supports visibility directly. If you need to visually hide the badge while keeping it in the accessibility tree, wrap the badge in s-box and set accessibilityVisibility="exclusive" on the box.
Migrating visibility
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return (
<s-box accessibilityVisibility="exclusive">
<s-badge>Fulfilled</s-badge>
</s-box>
);
}Pre-Polaris (2025-07)
import {
reactExtension,
Badge,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return <Badge visibility="hidden">Fulfilled</Badge>;
}Anchor to New propertiesNew properties
The Polaris badge component introduces the following new properties:
Anchor to colorcolor
Use the color property to control the intensity of the badge.
| Value | Description |
|---|---|
'base' | Uses the default badge color intensity. |
'subdued' | Uses a softer badge color intensity. |
Set color="subdued" with tone="auto" to match the previous tone="subdued" appearance.
Set color="subdued" with tone="auto" to match the previous tone="subdued" appearance.