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 is a pre-release version and is not production ready. 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="palette-accent" id="popover-one" placement="top" close-button-caption="Close" arrow="" style="" > <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.
string
-
Content
string
-
Palette
Define the popover color scheme.
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
-
Max width of the popover
Value can either be in vw, px or %. If no max-width is defined, the popover will extend to the width of its content.
string
280px
props
Close button caption*
Define the caption of the close button for assistive technology
string
Placement

Defines the position of the popover relative to its trigger. Popovers 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. For supported values and behavior details, see the Floating UI placement documentation.

"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.