Banner webcomponent for X4B
This project provides a webcomponent component for the banner
- Install the banner package
``sh`
npm install @x4b/webcomponent-banneror
yarn add @x4b/webcomponent-banner
- Install the fonts
By default, the banner uses the open sans font.
In the head of the HTML file, add the following code:
`html`
First, you have to register the webcomponent:
`javascript
import { register } from './library';
register();
`
Add the webcomponent to your application:
`javascript
notification-count="3"
application="scenario"
version="dev-test"
language="en"
languages="en,fr"
>
`
You can listen to the following DOM events:
| Event | Description | Parameter |
| --------------------------- | ------------------------------------------------- | ------------------------------------------------ |
| languageChanged | Triggered when a language is selected | Selected language |menuToggleButtonClicked
| | Triggered when the burger button is clicked | Menu state (true -> full size, false -> reduced) |notificationButtonClicked
| | Triggered when the notification button is clicked | None |tokenRefreshed
| | Triggered when the token is refreshed | None |startupFinished` | Triggered when the banner is initialized | None |
|