@lukana/alerts
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Lukana alerts

Alerts.

Usage

  1. Add @lukana/alerts/scss/alerts to Your style.scss file or use Your own styles.

  2. Import AlertsModule as dependency.

  3. Use somewhere in template

    <lukana-alerts></lukana-alerts>

    You can provide [position] attribute which is of type AlertsPosition. Default is top-right

  4. To print alert use AlertsService with one of these

    AlertsService.addSuccess('Success');
    AlertsService.addError('Error', 0);
    AlertsService.addInfo('Info');
    AlertsService.addWarning('Warning', 2000);

    As second param You can provide closeTime in miliseconds - default: 4000. If You give 0 it won't be closed automagically.

Positions

export enum AlertsPosition {
  TopRight = 'top-right',
  BottomRight = 'bottom-right',
  BottomLeft = 'bottom-left',
  TopLeft = 'top-left',
  TopFullWidth = 'top-full-width',
  BottomFullWidth = 'bottom-full-width',
}

Package Sidebar

Install

npm i @lukana/alerts

Weekly Downloads

1

Version

2.0.1

License

none

Unpacked Size

67.9 kB

Total Files

32

Last publish

Collaborators

  • piernik