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.
Cards provide a flexible and extensible content container with multiple variants and options.
Built with flexbox, they offer easy alignment and mix well with other components.
They have no fixed width to start, so they’ll naturally fill the full width of its parent element. This is easily customizable using the grid for example. For more details on that, read our grid docs.
next.design-system.post.ch/?path=/docs/605c788d-3f75-4e6c-8498-be3d546843c2--docs&story=Default#605c788d-3f75-4e6c-8498-be3d546843c2--default
/?path=/story/605c788d-3f75-4e6c-8498-be3d546843c2--default&full=true
This is the card content that can contain various types of information.
<post-linkarea> <div class="card"> <img src="https://picsum.photos/id/20/300/200" alt="" class="card-img-top" /> <div class="card-body"> <h5 class="card-title">Card Title</h5> <p class="card-text"> This is the card content that can contain various types of information. </p> <button class="btn btn-primary"> <span>Button Text</span> </button> </div> </div> </post-linkarea>
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/card.scss';
Card elements can contain many things, they can be interactive or not. Interactive cards will have a shadow and an hover effect. To make your card interactive, simply add the post-linkarea
component around it.
To read more about it, read our post-linkarea docs.
next.design-system.post.ch/?path=/docs/605c788d-3f75-4e6c-8498-be3d546843c2--docs&story=Foundation#605c788d-3f75-4e6c-8498-be3d546843c2--foundation
/?path=/story/605c788d-3f75-4e6c-8498-be3d546843c2--foundation&full=true
Non-interactive card
<div class="card p-16"> <p>Non-interactive card</p> </div> <post-linkarea> <div class="card p-16"> <p><a href="http://google.com">Interactive card</a></p> </div> </post-linkarea>
Cards should never be the same color as its section's background. Therefore, depending on the palette, the card's background color will adapt.
next.design-system.post.ch/?path=/docs/605c788d-3f75-4e6c-8498-be3d546843c2--docs&story=Palette#605c788d-3f75-4e6c-8498-be3d546843c2--palette
/?path=/story/605c788d-3f75-4e6c-8498-be3d546843c2--palette&full=true
Cards support a wide variety of content, including images, text, links, and more. This applies to the body of the card as well as its header and footer.
next.design-system.post.ch/?path=/docs/605c788d-3f75-4e6c-8498-be3d546843c2--docs&story=Custom Content#605c788d-3f75-4e6c-8498-be3d546843c2--custom-content
/?path=/story/605c788d-3f75-4e6c-8498-be3d546843c2--custom-content&full=true
Language: English
Create lists of content in a card by simply using a flush list group in place of the card body.
next.design-system.post.ch/?path=/docs/605c788d-3f75-4e6c-8498-be3d546843c2--docs&story=List Group#605c788d-3f75-4e6c-8498-be3d546843c2--list-group
/?path=/story/605c788d-3f75-4e6c-8498-be3d546843c2--list-group&full=true
next.design-system.post.ch/?path=/docs/605c788d-3f75-4e6c-8498-be3d546843c2--docs&story=Background Image#605c788d-3f75-4e6c-8498-be3d546843c2--background-image
/?path=/story/605c788d-3f75-4e6c-8498-be3d546843c2--background-image&full=true