The official Swiss Post Internet Header implementation, built with Stencil JS.
The header docs are part of the storybook docs for the Design System.
There are two possibilities to install the header on a page.
Use this if your project uses a bundler or a framework like Angular, React or Vue.
npm install @swisspost/internet-header
<!-- index.html -->
<body>
<swisspost-internet-header project="your-project-id"></swisspost-internet-header>
...
</body>
// main.ts / index.js / ...
import { defineCustomElements } from '@swisspost/internet-header/loader';
defineCustomElements();
// main.ts / index.js / ...
import '@swisspost/internet-header/dist/swisspost-internet-header/swisspost-internet-header.esm';
Use this if you want to use the CDN version and if you don't use a bundler or a framework.
Make sure to replace {version}
with the version you want to use or remove @{version}
to use the latest version.
<!DOCTYPE html>
<html>
<body>
<swisspost-internet-header project="your-project-id"></swisspost-internet-header>
</body>
<script type="module">
import { defineCustomElements } from 'https://unpkg.com/@swisspost/internet-header@{version}/loader/index.es2017.js';
defineCustomElements();
</script>
</html>
<!-- index.html -->
<head>
<script
async
type="module"
src="https://unpkg.com/@swisspost/internet-header@{version}/dist/swisspost-internet-header/swisspost-internet-header.esm.js"
></script>
</head>
<body>
<swisspost-internet-header project="your-project-id"></swisspost-internet-header>
</body>
Considering supporting the Swiss Post Design System with your contribution? Whether you like to contribute new patterns, fix a bug, spotted a typo or have ideas for improvement - we'd love to hear from you. Learn how you can contribute to this project in the header contribution guidelines and also take a look at the general contribution guidelines.
For any questions regarding the pattern library, you can reach out on the discussions page.
In order to keep our community open and inclusive, we expect you to read and follow our Code of Conduct.
Software contained in this repository is published by the Swiss Post Ltd. under the Apache 2.0 License.
© 2024 Swiss Post, Ltd.