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 <table>
element with CSS that changes the element’s
initial appearance.
next.design-system.post.ch/?path=/docs/81799516-470c-446b-a049-54946b6ccfca--docs&story=Default#81799516-470c-446b-a049-54946b6ccfca--default
/?path=/story/81799516-470c-446b-a049-54946b6ccfca--default&full=true
# | First | Last | Handle |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @fat |
3 | Larry | the Bird | |
4 | Someone |
else
entirely |
<table class="table align-top"> <caption class=""> List of users </caption> <thead> <tr> <th scope="col">#</th> <th scope="col">First</th> <th scope="col">Last</th> <th scope="col">Handle</th> </tr> </thead> <tbody> <tr> <th scope="row">1</th> <td>Mark</td> <td>Otto</td> <td>@mdo</td> </tr> <tr> <th scope="row">2</th> <td>Jacob</td> <td>Thornton</td> <td>@fat</td> </tr> <tr> <th scope="row">3</th> <td>Larry</td> <td>the Bird</td> <td>@twitter</td> </tr> <tr> <th scope="row">4</th> <td>Someone</td> <td> else <br /> entirely </td> <td>@twitter</td> </tr> </tbody> </table>
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/table.scss';
When buttons are placed in a table, be sure to use alignment: middle
, respectively <tbody class="align-middle">
to nicely align the content and the buttons.
If an interactive data table is needed, we recommend the table component from the PrimeNG UI Suite. To make it look like a Swiss Post component, please use our @swisspost/design-system-styles-primeng package.
However, this component can only be used in Angular projects. See the PrimeNG Table documentation for full usage instructions.
The LTS versions would need a license, so it's recommended not to use LTS. https://primeng.org/table