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.
The Design System Angular Components, ready for use in your Angular project.
Version | Angular |
---|---|
1.x | 16.x |
2.x | 16.x |
7.x | 16.x || 17.x |
8.x | 18.x |
npm install @swisspost/design-system-components-angular
Import the packages global styles. They are required for the components to work properly.
@use '@swisspost/design-system-components-angular/post-components.css';
Importing the components to your project.
// app.module.ts import { NgModule } from '@angular/core'; import { PostComponentsModule } from '@swisspost/design-system-components-angular'; @NgModule({ // ... imports: [PostComponentsModule], // ... }) export class AppModule {}
Usage within your template.
<!-- app.component.html --> <post-icon *ngIf="condition" [attr.name]="iconName"></post-icon>
Angular components use inline scripts and styles.
To enable their execution while enforcing a strict Content Security Policy (CSP), you can use a CSP nonce
.
A nonce is a randomly generated word or phrase intended for one-time use, which must update with each HTTP response.
Inline scripts or styles with a nonce
attribute matching the current nonce value set in the CSP will execute properly, while others will be blocked.
Learn more in the CSP nonce documentation.
There are two ways to configure Angular to automatically set nonce
attributes:
ngCspNonce
attribute on the root application element.CSP_NONCE
injection token.This configuration will also apply automatically to components in the Components for Angular package. For more details, refer to the Angular security guide.
@swisspost/design-system-components/post-components/post-components.css
@swisspost/design-system-components-angular/post-components.css
@swisspost/design-system-components-react/post-components.css
(by @oliverschuerch with #5165)post-avatar
to show an avatar, based on different possible input data (gravatar by email, initials by first- and/or lastname, fallback). (by @oliverschuerch with #3352)[for]="$id"
). The checks are now delayed to work around this issue. (by @gfellerph with #3775)post-collapsible-trigger
component to properly handle the role, ARIA attributes, and event listeners for elements that toggle a post-collapsible
. (by @alizedebray with #3209)Redefined the dependency to the web components package as a dependency instead of a peer dependency due to a known bug in changesets that causes major version bumps across all linked workspace packages if one of them is installed as a peer dependency. (by @gfellerph with #3169)
Updated PostComponentsModule
to enable its use in lazy-loaded modules. (by @alizedebray with #3118)
@swisspost/design-system-components
package as a peer dependency as recommended by stenciljs. This way, installing @swisspost/design-system-components
package as a direct dependency should not be necessary anymore in consumer projects. (by @oliverschuerch with #3116)heading-level
property on the post-accordion
component to set the heading level of all post-accordion-item
children at once. (by @alizedebray with #3104)Synchronized the versions of the following packages:
This will help understanding the dependencies between these packages at a glance but also means that for the individual pacakges, semver is no longer being used. This enables us also to talk about and document Design System versions as a whole instead of documenting the fragmented versions in a complex lookup table. (by @gfellerph with #2856)
Added support for Angular 17. (by @alizedebray with #2760)
We are introducing the new package @swisspost/design-system-components-angular
🥳, which provides a corresponding Angular component for all our web-components. For those working on an Angular app this means:
@swisspost/design-system-components
, which provides native web components, the new package can be used.CUSTOM_ELEMENTS_SCHEMA
schema is history.