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.

Popover

Popovers are similar to tooltips. They're small overlays that open on demand after a buyer interaction. The difference is that the popover can contain more content, without cluttering the page. They must be specified inside the overlay prop of an activator component (Button, Link, or Pressable).

The library automatically applies the WAI-ARIA Popover Widget pattern to both the activator and the popover content.

Support
Targets (50)

Supported targets


Anchor to alignment
alignment
Default: 'center'

The alignment of the popover in the axis determined by the position.

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 maxInlineSize
maxInlineSize
< number | `${number}%` | 'fill' >

The maximum inline size (maximum width in horizontal writing modes). The element won't grow wider than this value.

  • number: The size in pixels.
  • `${number}%`: The size as a percentage of the parent container's inline size.
  • 'fill': Takes all the available space.

Learn more about the max-inline-size property.

Anchor to minInlineSize
minInlineSize
< number | `${number}%` | 'fill' >

The minimum inline size (minimum width in horizontal writing modes). The element won't shrink narrower than this value.

  • number: The size in pixels.
  • `${number}%`: The size as a percentage of the parent container's inline size.
  • 'fill': Takes all the available space.

Learn more about the min-inline-size property.

Anchor to onClose
onClose
() => void

A callback fired when the popover is closed.

Anchor to onOpen
onOpen
() => void

A callback fired when the popover is opened.

Anchor to padding
padding
<<>>

The padding on all edges of the element, using a shorthand syntax. You can specify one, two, or four values following the CSS shorthand convention.

  • T: A single value applied uniformly to all edges.
  • [T, T]: The first value applies to block-start and block-end, the second to inline-start and inline-end.
  • [T, T, T, T]: Values apply to block-start, inline-end, block-end, and inline-start respectively.
Anchor to position
position
Default: 'blockStart'

The position of the popover relative to the activator.


Basic Popover

Example

Basic Popover

import {
reactExtension,
Pressable,
Popover,
View,
TextBlock,
} from '@shopify/ui-extensions-react/checkout';

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

function Extension() {
return (
<Pressable
overlay={
<Popover>
<View
maxInlineSize={200}
padding="base"
>
<TextBlock>
A thoughtful way to pay
</TextBlock>
<TextBlock>Tap don’t type</TextBlock>
<TextBlock>
Shop Pay remembers your important
details, so you can fill carts, not
forms. And everything is encrypted
so you can speed safely through
checkout.
</TextBlock>
</View>
</Popover>
}
>
More info
</Pressable>
);
}
import {
extension,
Pressable,
Popover,
View,
TextBlock,
} from '@shopify/ui-extensions/checkout';

export default extension('purchase.checkout.block.render', (root) => {
const popoverFragment = root.createFragment();
const popover = root.createComponent(Popover, {}, [
root.createComponent(View, {maxInlineSize: 200, padding: 'base'}, [
root.createComponent(TextBlock, {}, 'A thoughtful way to pay'),
root.createComponent(TextBlock, {}, 'Tap don’t type'),
root.createComponent(
TextBlock,
{},
'Shop Pay remembers your important details, so you can fill carts, not forms. And everything is encrypted so you can speed safely through checkout.',
),
]),
]);
popoverFragment.appendChild(popover);
const pressable = root.createComponent(
Pressable,
{overlay: popoverFragment},
'More info',
);

root.appendChild(pressable);
});

Use popovers if:

  • The intent is to ask the buyer for information.

  • It’s possible to use at most two rows of input fields to get the information.



Was this page helpful?