No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.


  

Popover

For longer, informative messages or explanations and also simple interactive elements like links.

Optional title

A longer message that needs more time to read. Links are also possible.

<div class="d-flex justify-content-center"> <button class="btn btn-secondary btn-large" data-popover-target="popover-one"> Click here to see a popover </button> </div> <post-popover class="hydrated bg-primary" id="popover-one" placement="top" arrow=""> <h2 class="h6">Optional title</h2> <p class="mb-0"> A longer message that needs more time to read. <a href="#">Links</a> are also possible. </p> </post-popover>
NameDescriptionDefaultControl
General
Id
The id is used to connect a trigger element with the popover.
<button data-popover-target="..."> is the only valid trigger element for post-popover.
-
Content
-
Background color
Define a background color, either bg-primary or bg-yellow.
HTML class attribute
-
Show title
Show an optional title, the heading level can be chosen to match the document structure, use the .h6 class for appropriate styling.
-
props
Close button caption*
Define the caption of the close button for assistive technology
string
Placement

Defines the placement of the popover according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement. Popoverss are automatically flipped to the opposite side if there is not enough available space and are shifted towards the viewport if they would overlap edge boundaries.

"bottom""bottom-end""bottom-start""left""left-end""left-start""right""right-end"
'top'
Arrow
Show a little indicator arrow
boolean
true
methods
hide
Programmatically hide this popover
hide() => Promise<void>
--
show
Programmatically display the popover
show(target: HTMLElement) => Promise<void>
--
toggle
Toggle popover display
toggle(target: HTMLElement, force?: boolean) => Promise<void>
--

The <post-popover> element is part of the @swisspost/design-system-components package. For more information, read the getting started with components guide.