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.

Chip

Display small pieces of information with which users can interact.
<div class="chip chip-filter"> <input class="chip-filter-input" id="chip-example--default" name="chip-example--default" type="checkbox" /> <label class="chip-filter-label" for="chip-example--default"> <span class="chip-text">Chip</span> </label> </div>
NameDescriptionDefaultControl
Content
Text
The text contained in the chip.
string
-
General
Size
The size of the chip.
string
-
Type
Defines how the chip can be interacted with.
string
-
Disabled
If true, the chip is disabled.
boolean
-
Active
If true, the chip is active.
boolean
-
Nested Badge
If true, a badge is displayed inside the chip.
boolean
-

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/chip.scss';

Filter chips provide a simple means to refine content or search results based on specific attributes. They are personalized checkboxes, allowing users to toggle them to filter content effectively.

Travel Itineraries

Alternatively, filter chips may be used with radio inputs when a single filter selection is needed.

Search Results

Dismissible chips represent pieces of information entered by a user. Each chip includes a close button, enabling users to conveniently remove them from view.

It's important to note that the close icon lacks visible text. Therefore, it's imperative to include a visually hidden label to ensure accessibility for users relying on assistive technologies.