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.
Customize the native <input>
with CSS that changes the element’s initial appearance.
Custom input elements need only the class .form-control
to trigger the custom styles.
next.design-system.post.ch/?path=/docs/2df77c32-5e33-402e-bd2e-54d54271ce19--docs&story=Default#2df77c32-5e33-402e-bd2e-54d54271ce19--default
/?path=/story/2df77c32-5e33-402e-bd2e-54d54271ce19--default&full=true
This is helpful text that provides guidance or additional information to assist the user in filling out this field correctly.
<div class="form-floating"> <input id="2df77c32-5e33-402e-bd2e-54d54271ce19--default" class="form-control" type="text" placeholder="Placeholder" aria-describedby="form-hint-2df77c32-5e33-402e-bd2e-54d54271ce19--default" /> <label class="form-label" for="2df77c32-5e33-402e-bd2e-54d54271ce19--default">Label</label> <p class="form-hint" id="form-hint-2df77c32-5e33-402e-bd2e-54d54271ce19--default"> This is helpful text that provides guidance or additional information to assist the user in filling out this field correctly. </p> </div>
Make sure the @swisspost/design-system-styles
package is already present in your project or follow the installation guidelines.
To import all Design System styles:
@use '@swisspost/design-system-styles/post-compact.scss';
To import only the styles required for this component:
@use '@swisspost/design-system-styles/basics.scss'; @use '@swisspost/design-system-styles/components/form-input.scss'; // required if you use validation feedbacks @use '@swisspost/design-system-styles/components/validation.scss';
The following examples show the different characteristics of the component. These can differ in the type of visualization, the HTML structure, as well as when, how and why they are displayed.
Wrap a pair of <input>
and <label>
elements in a .form-floating
container to enable floating labels.
But note that the <input>
element must come first, so we can ensure the correct styles.
Ensure that placeholder
attribute is set (even with an empty value) so the label can act as a placeholder when no value is set.
next.design-system.post.ch/?path=/docs/2df77c32-5e33-402e-bd2e-54d54271ce19--docs&story=Floating Label#2df77c32-5e33-402e-bd2e-54d54271ce19--floating-label
/?path=/story/2df77c32-5e33-402e-bd2e-54d54271ce19--floating-label&full=true