Popover
The popover component displays contextual content in an overlay triggered by a button using the commandFor attribute. Use for secondary actions, settings, or information that doesn't require a full modal.
For interactions that need more space or user focus, such as confirmations or complex forms, use modal instead.
Anchor to PropertiesProperties
Configure the following properties on the popover component.
- Anchor to blockSizeblockSizeblockSizeSizeUnitsOrAutoSizeUnitsOrAutoDefault: 'auto'Default: 'auto'requiredrequired
The vertical size of the element in standard layouts (height in left-to-right or right-to-left writing modes).
Block size adjusts based on the writing direction: in horizontal layouts, it controls the height; in vertical layouts, it controls the width. This ensures consistent behavior across different text directions.
Learn more about the block-size property.
: Specific size values in pixels, percentages, or zero for precise control.auto: Automatically sizes based on content and layout constraints.
- Anchor to minBlockSizeminBlockSizeminBlockSizeSizeUnitsSizeUnitsDefault: '0'Default: '0'requiredrequired
The minimum vertical size of the element in standard layouts (min-height in left-to-right or right-to-left writing modes).
Prevents the element from becoming smaller than this size along the block axis.
Learn more about the min-block-size property.
- Anchor to maxBlockSizemaxBlockSizemaxBlockSizeSizeUnitsOrNoneSizeUnitsOrNoneDefault: 'none'Default: 'none'requiredrequired
The maximum vertical size of the element in standard layouts (max-height in left-to-right or right-to-left writing modes).
Prevents the element from becoming larger than this size along the block axis.
Learn more about the max-block-size property.
- Anchor to inlineSizeinlineSizeinlineSizeSizeUnitsOrAutoSizeUnitsOrAutoDefault: 'auto'Default: 'auto'requiredrequired
The horizontal size of the element in standard layouts (width in left-to-right or right-to-left writing modes).
Inline size adjusts based on the writing direction: in horizontal layouts, it controls the width; in vertical layouts, it controls the height. This ensures consistent behavior across different text directions.
Learn more about the inline-size property.
: Specific size values in pixels, percentages, or zero for precise control.auto: Automatically sizes based on content and layout constraints.
- Anchor to minInlineSizeminInlineSizeminInlineSizeSizeUnitsSizeUnitsDefault: '0'Default: '0'requiredrequired
The minimum horizontal size of the element in standard layouts (min-width in left-to-right or right-to-left writing modes).
Prevents the element from becoming smaller than this size along the inline axis.
Learn more about the min-inline-size property.
- Anchor to maxInlineSizemaxInlineSizemaxInlineSizeSizeUnitsOrNoneSizeUnitsOrNoneDefault: 'none'Default: 'none'requiredrequired
The maximum horizontal size of the element in standard layouts (max-width in left-to-right or right-to-left writing modes).
Prevents the element from becoming larger than this size along the inline axis.
Learn more about the max-inline-size property.
SizeUnitsOrAuto
Represents size values that can also be set to `auto` for automatic sizing. - `SizeUnits`: Specific size values in pixels, percentages, or zero for precise control. - `auto`: Automatically sizes based on content and layout constraints.
SizeUnits | 'auto'SizeUnits
Represents size values in pixels, percentages, or zero. - `${number}px`: Absolute size in pixels for fixed dimensions (such as `100px`, `24px`). - `${number}%`: Relative size as a percentage of the parent container (such as `50%`, `100%`). - `0`: Zero size, equivalent to no dimension.
`${number}px` | `${number}%` | `0`SizeUnitsOrNone
Represents size values that can also be set to `none` to remove the size constraint. - `SizeUnits`: Specific size values in pixels, percentages, or zero for precise control. - `none`: No size constraint, allowing unlimited growth.
SizeUnits | 'none'Anchor to EventsEvents
The popover component provides event callbacks for handling user interactions. Learn more about handling events.
- Anchor to afterhideafterhideafterhideCallbackEventListener<TTagName> | nullCallbackEventListener<TTagName> | nullrequiredrequired
A callback fired after the popover is hidden.
- Anchor to aftershowaftershowaftershowCallbackEventListener<TTagName> | nullCallbackEventListener<TTagName> | nullrequiredrequired
A callback fired after the popover is shown.
- Anchor to aftertoggleaftertoggleaftertoggleCallbackEventListener<TTagName> | nullCallbackEventListener<TTagName> | nullrequiredrequired
A callback fired after the popover is toggled.
- Anchor to hidehidehideCallbackEventListener<TTagName> | nullCallbackEventListener<TTagName> | nullrequiredrequired
A callback fired when the popover is hidden.
- Anchor to showshowshowCallbackEventListener<TTagName> | nullCallbackEventListener<TTagName> | nullrequiredrequired
A callback fired when the popover is shown.
- Anchor to toggletoggletoggleCallbackEventListener<TTagName> | nullCallbackEventListener<TTagName> | nullrequiredrequired
A callback fired when the popover is toggled.
CallbackEventListener
A function that handles events from UI components. This type represents an event listener callback that receives a `CallbackEvent` with a strongly-typed `currentTarget`. Use this for component event handlers like `click`, `focus`, `blur`, and other DOM events.
(EventListener & {
(event: CallbackEvent<T>): void;
}) | nullCallbackEvent
An event object with a strongly-typed `currentTarget` property that references the specific HTML element that triggered the event. This type extends the standard DOM `Event` interface and ensures type safety when accessing the element that fired the event.
Event & {
currentTarget: HTMLElementTagNameMap[T];
}Anchor to SlotsSlots
The popover component supports slots for additional content placement within the component. Learn more about using slots.
- Anchor to childrenchildrenchildrenHTMLElementHTMLElement
The content displayed within the popover component, which appears in an overlay positioned relative to its trigger element.
Anchor to ExamplesExamples
Show contextual options without navigating away from the current page. This example presents an action menu with edit and delete options.
Preview
html
Anchor to Display notification listDisplay notification list
Surface time-sensitive information on demand. This example displays a notification list with order, inventory, and payment alerts.
Preview
html
Anchor to Configure table display optionsConfigure table display options
Let merchants customize their view without leaving the page. This example presents a column visibility picker with an apply button.
Preview
html
Anchor to Show inventory detailsShow inventory details
Show supplementary information without cluttering the main view. This example displays stock levels across multiple warehouse locations.
Preview
html
Anchor to Filter with apply and clearFilter with apply and clear
Build inline filtering without navigating to a separate page. This example combines a choice list with apply and clear buttons, plus dynamic trigger text.
Preview
html
Anchor to Best practicesBest practices
- Use for secondary or less important information and actions since they're hidden until triggered.
- Contain actions that share a relationship to each other.
- Be triggered by a clearly labeled default or tertiary button.
Anchor to LimitationsLimitations
- Popovers can only be opened by user interaction, not programmatically on page load.
- The popover position is determined by the trigger button and cannot be manually overridden.
- Content within the popover does not scroll automatically; use box or section for internal scrolling if needed.