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:
This is a pre-release version and is not production ready. For new and ongoing projects, please refer to the latest Design System version.
A toggle button component to switch between two states and display different content based on the current state.
preview-6152--swisspost-design-system-next.netlify.app/?path=/docs/1a6f47c2-5e8a-45a0-b1c3-9f7e2b834c24--docs&story=Default#1a6f47c2-5e8a-45a0-b1c3-9f7e2b834c24--default
/?path=/story/1a6f47c2-5e8a-45a0-b1c3-9f7e2b834c24--default&full=true
<post-togglebutton class="btn btn-primary"> <span data-showwhen="untoggled">Untoggled</span> <span data-showwhen="toggled">Toggled</span> </post-togglebutton>
The <post-togglebutton>
element is part of the @swisspost/design-system-components
package. For more information, read the getting started with components guide.
You can set the button to be toggled initially by using the toggled
attribute. When set, the component will start in the toggled state and display the corresponding content.
preview-6152--swisspost-design-system-next.netlify.app/?path=/docs/1a6f47c2-5e8a-45a0-b1c3-9f7e2b834c24--docs&story=Initially Toggled#1a6f47c2-5e8a-45a0-b1c3-9f7e2b834c24--initially-toggled
/?path=/story/1a6f47c2-5e8a-45a0-b1c3-9f7e2b834c24--initially-toggled&full=true
The toggle button can contain any text or inline element.
You can control the visibility of an element based on the state of the toggle button using the data-showwhen
attribute.
data-showwhen="toggled"
attribute, it will be visible when the button is toggled on.data-showwhen="untoggled"
attribute, it will be visible when the button is toggled off.data-showwhen
attribute, it will always be visible, regardless of the button's state.preview-6152--swisspost-design-system-next.netlify.app/?path=/docs/1a6f47c2-5e8a-45a0-b1c3-9f7e2b834c24--docs&story=Content Visibility#1a6f47c2-5e8a-45a0-b1c3-9f7e2b834c24--content-visibility
/?path=/story/1a6f47c2-5e8a-45a0-b1c3-9f7e2b834c24--content-visibility&full=true