Migrate Popover to the Polaris popover component
The Polaris popover component displays transient content anchored to a trigger. It replaces the previous Popover component and is available as <s-popover> in API versions 2025-10 and newer.
Anchor to Updated propertiesUpdated properties
The following properties are different in the Polaris popover component.
Anchor to onOpenon Open
The previous Popover onOpen prop is now called onShow. The handler now receives an Event instead of being called with no arguments.
Anchor to onCloseon Close
The previous Popover onClose prop is now called onHide. The handler now receives an Event instead of being called with no arguments.
Anchor to SizesSizes
The size properties accept updated values in the Polaris popover component. Previous unitless number values map to pixels. For example, 300 is now '300px'.
| Property | Previous values | New values | Migration notes |
|---|---|---|---|
maxInlineSize | number | `${number}%` | 'fill' | `${number}px` | `${number}%` | '0' | 'none' | fill is removed. Use 100% instead. |
minInlineSize | number | `${number}%` | 'fill' | `${number}px` | `${number}%` | '0' | fill is removed. Use 100% instead. |
Anchor to Updated patternsUpdated patterns
Anchor to ActivationActivation
The previous pattern of nesting Popover inside a trigger's overlay prop has been replaced with command and commandFor on the trigger, targeting a sibling <s-popover> by ID.
| Previous pattern | New pattern |
|---|---|
overlay={<Popover>…</Popover>} on a trigger (Button, Link, or Pressable) | command="--toggle" + commandFor="popover-id" on the trigger pointing to a sibling <s-popover id="popover-id">…</s-popover> |
The command prop defaults to --auto, which resolves to --toggle for popovers. You can omit command when targeting a popover and only set commandFor.
The command prop defaults to --auto, which resolves to --toggle for popovers. You can omit command when targeting a popover and only set commandFor.
Migrating Popover to s-popover
Latest (Preact)
import '@shopify/ui-extensions/preact';
import {render} from 'preact';
export default function extension() {
render(<Extension />, document.body);
}
function Extension() {
return (
<>
<s-button command="--toggle" commandFor="details">
Show details
</s-button>
<s-popover id="details">
<s-text>Free shipping on orders over $50.</s-text>
</s-popover>
</>
);
}Pre-Polaris (2025-07)
import {
reactExtension,
Button,
Popover,
Text,
} from '@shopify/ui-extensions-react/checkout';
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
return (
<Button
overlay={
<Popover>
<Text>Free shipping on orders over $50.</Text>
</Popover>
}
>
Show details
</Button>
);
}Anchor to New propertiesNew properties
The Polaris popover component introduces the following new properties:
| New prop | Type | Description |
|---|---|---|
blockSize | `${number}px` | `${number}%` | '0' | 'auto' | Adjusts the block size of the popover. |
inlineSize | `${number}px` | `${number}%` | '0' | 'auto' | Adjusts the inline size of the popover. |
maxBlockSize | `${number}px` | `${number}%` | '0' | 'none' | Adjusts the maximum block size of the popover. |
minBlockSize | `${number}px` | `${number}%` | '0' | Adjusts the minimum block size of the popover. |
Anchor to Removed propertiesRemoved properties
Anchor to alignment and positionalignment and position
The previous Popover alignment and position props have been removed. The Polaris popover positions itself relative to the trigger automatically and repositions to avoid overflowing the viewport — which was the primary use case for the previous alignment and position props.
Anchor to paddingpadding
The previous Popover padding prop has been removed. The Polaris popover applies its own built-in padding that can't be removed or overridden. If you need additional space around the content, wrap it in an <s-box> with extra padding.