Skip to main content

BwPopover | bw-popover

Overview

Popovers are used to display content in a floating overlay.

Usage

Basic

Open Popover

Hello

<bw-popover placement="top-end">
<bw-button slot="trigger">Open Popover</bw-button>
<div style="padding: 12px;">
<p>Hello</p>
</div>
</bw-popover>

Properties

PropertyAttributeDescriptionTypeDefault
arrowarrowRenders an arrow pointing to the triggerbooleantrue
arrowPaddingarrow-paddingThe padding between the arrow and the edges of the popover. Useful if you change the border-radius of the popovernumber6
backdropDismissbackdrop-dismissBackdrop will dismiss the popover on click when enabledbooleantrue
destroydestroyExecute a callback after the popover has dismissed() => void | Promise<void>undefined
dismissOnClickdismiss-on-clickPopover will automatically dismiss itself when something is clicked in the popover when enabledbooleanfalse
initinitExecute a callback before the popover starts presenting() => void | Promise<void>undefined
matchWidthmatch-widthIf the popover should match the width of the trigger elementbooleanfalse
offsetXoffset-xHorizontal offset used when auto positioning the popover contentnumber0
offsetYoffset-yVertical offset used when auto positioning the popover contentnumber10
openopenOpens/closes the popoverbooleanfalse
placementplacementWhere the popover should be placed"bottom" | "bottom-end" | "bottom-start" | "left" | "left-end" | "left-start" | "right" | "right-end" | "right-start" | "top" | "top-end" | "top-start"undefined
positionStrategyposition-strategyIf the popover should position itself using the mouse event or the triggerElement."click" | "element"'element'
triggerActiontrigger-action- click: Popover will show on left click or tap on mobile. - context-menu: Popover will show on right click or press on mobile. - hover: Popover will show on hover or tap on mobile."click" | "context-menu" | "hover"'click'

Events

EventDescriptionType
openChangeEmits when the popover is toggledCustomEvent<boolean>
popoverDismissEmits when the popover is closedCustomEvent<{ role?: string; data?: any; }>
popoverPresentEmits when the popover is openedCustomEvent<any>
readyEmits when the popover has completed it's initial renderCustomEvent<any>

Methods

dismiss(role?: string, data?: any) => Promise<void>

Dismisses the popover

Parameters

NameTypeDescription
rolestring- The role of the element that dismissed the popover
dataany- The data of the element that dismissed the popover

Returns

Type: Promise<void>

present() => Promise<void>

Presents the popover

Returns

Type: Promise<void>

Slots

SlotDescription
The content of the popover
"trigger"The trigger element of the popover

Shadow Parts

PartDescription
"arrow"The arrow of the popover
"content"The content of the popover
"content-container"The container of the popover content

CSS Custom Properties

NameDescription
--backgroundThe background color of the content container
--borderThe border of the content container
--colorThe text color of the content container
--paddingThe padding of the content container
--radiusThe radius of the content container

Dependencies

Used by

Graph


© 2025 United Systems & Software - All Rights Reserved.