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.

The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:

  1. Missing Context/Providers: You can use decorators to supply specific contexts or providers, which are sometimes necessary for components to render correctly. For detailed instructions on using decorators, please visit the Decorators documentation.
  2. Misconfigured Webpack or Vite: Verify that Storybook picks up all necessary settings for loaders, plugins, and other relevant parameters. You can find step-by-step guides for configuring Webpack or Vite with Storybook.
  3. Missing Environment Variables: Your Storybook may require specific environment variables to function as intended. You can set up custom environment variables as outlined in the Environment Variables documentation.

This version is no longer actively maintained and has reached End-of-Life (EOL). For new and ongoing projects, please refer to the latest Design System version.

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.
string
-
Content
string
-
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.
boolean
-
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.