@patrik-alexits/alert-webcomponent
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

@patrik-alexits/alert-webcomponent

Experimental Hybrids.js-based Web Component for an "alert" functionality. This component allows the creation of customised alerts.

Installation

To install this component, use the following command:

npm install @patrik-alexits/alert-webcomponent

Usage

The component only works if the parent of the component in the DOM is the document.body. First, import the component in your JavaScript or TypeScript file:

import '@patrik-alexits/alert-webcomponent';

You can then use the component in your HTML:

<app-alert
    type="warning"
    text="The app is still in development, some features might not work"
    dismissable="true"
    duration="2000">
</app-alert>

Interface "IAlert"

The component provides the following interface for customizing its content:

  • type: string: Defines the look of the component.
  • text: string: The text of the component to be displayed.
  • dismissable?: string | boolean: Optional. Sets the duration of the component to be displayed.
  • duration?: string | number: Optional. Sets the duration of the dismissable option in milliseconds.

License

This project is ISC licensed.

Package Sidebar

Install

npm i @patrik-alexits/alert-webcomponent

Weekly Downloads

7

Version

1.0.7

License

ISC

Unpacked Size

13.2 kB

Total Files

11

Last publish

Collaborators

  • patrik-alexits