npm.io
1.0.5 • Published 1 year ago

@zanichelli/zanichelli-notifiche

Licence
MIT
Version
1.0.5
Deps
1
Size
1.5 MB
Vulns
0
Weekly
0
Stars
289

Zanichelli LaZ-Notifiche Component

Use this component to show notifications to users.

Installation

Download the package by running yarn add @zanichelli/zanichelli-notifiche

or import it in your html using Unpkg:

<script type="module" src="https://unpkg.com/@zanichelli/zanichelli-notifiche"></script>

Albe Web Components dependency

This component requires the Albe Web Components Library. To get Albe you can:

  • install it via NPM by running yarn add @zanichelli/albe-web-components
  • include it in your app inside a script tag:
<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/@zanichelli/albe-web-components/dist/web-components-library/web-components-library.esm.js"
></script>

Remember to also include the stylesheet:

<link
  type="text/css"
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@zanichelli/albe-web-components/www/build/web-components-library.css"
/>

Using custom elements
import { defineCustomElements as defineAlbeComponents, applyPolyfills } from "@zanichelli/albe-web-components/loader";
import { defineCustomElements as defineZanichelliNotifiche } from "@zanichelli/zanichelli-notifiche/dist/wc/loader";

applyPolyfills().then(() => {
  defineAlbeComponents();
  defineZanichelliNotifiche();
});

return <zanichelli-notifiche></zanichelli-notifiche>;

Development
  • Download the repo using git clone git@bitbucket.org:zanichelli/laz-notifiche.git
  • Run yarn
  • Run yarn start

To use component from local (and to run cypress tests) the host must be dev-notifications.zanichelli.it:3333

  • so add in your own file /etc/hosts 127.0.0.1 dev-notifications.zanichelli.it