Skip to main content

Popover

Popovers are used to display content in an overlay that can be triggered by a button.

Anchor to blockSize
blockSize
Default: 'auto'

Adjust the block size.

Anchor to inlineSize
inlineSize
Default: 'auto'

Adjust the inline size.

Anchor to maxBlockSize
maxBlockSize
Default: 'none'

Adjust the maximum block size.

Anchor to maxInlineSize
maxInlineSize
Default: 'none'

Adjust the maximum inline size.

Anchor to minBlockSize
minBlockSize
Default: '0'

Adjust the minimum block size.

Anchor to minInlineSize
minInlineSize
Default: '0'

Adjust the minimum inline size.

Learn more about registering events.

Anchor to afterhide
afterhide
<TTagName> | null
Anchor to aftershow
aftershow
<TTagName> | null
Anchor to aftertoggle
aftertoggle
<TTagName> | null
<TTagName> | null
<TTagName> | null
Anchor to toggle
toggle
<TTagName> | null

Anchor to children
children
HTMLElement

The content of the Popover.

Examples
<>
<s-button commandFor="product-options-popover">Product options</s-button>

<s-popover id="product-options-popover">
<s-stack direction="block">
<s-button variant="tertiary">Import</s-button>
<s-button variant="tertiary">Export</s-button>
</s-stack>
</s-popover>
</>

Preview

Popovers are closed by default and should be triggered by a button using the commandFor attribute. The button's commandFor value should match the popover's id. The popover's position is determined by the button that triggers it.

  • 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

  • Use clear action verbs in the {verb}+{noun} format (e.g., "Create order", "Edit HTML")
  • Avoid unnecessary words like "the", "an", or "a"
Was this page helpful?