npm

flash-messages-ak

1.0.1 • Public • Published

Flash Message

Simple javascript which can used from anywhere in your application. once this function is triggered it will display the provided message on the screen.

Install

npm install --save flash-messages-ak

and of course you need to require the package:

require('flash-messages-ak')

Or you can added directly from unpack cdn as follow:

<script src="https://unpkg.com/flash-messages-ak"></script>
 

Usage

once you installed this package you can call the flashMsg() from anywhere in your app for example

flashMsg("My Message", 1000 , "success" , "top" , "left")

Arguments

The flashMsg function accept five arguments as follow:

  • message

    • type: String
    • default: none
    • description: here where you can specify the text content of the flash message
  • timeout

    • type: Number
    • default: 2000
    • description: through this argument you can specify how long this flash message will be displayed on the screen
  • level

    • type: String
    • default: successs
    • options: success or danger
    • description: this argument give you the ability to specify the background color of the flash message success light green danger light red.
  • position

    • type: String
    • default: bottom
    • options: bottom , top
    • description: you can specify the position of the flash message either bottom or top of the screen
  • alignment

    • type: String
    • default: right
    • options: right , left
    • description: you can specify the alignment of this flash message either left or right of the screen

Scren Shots

Screen Shot 1

Screen Shot 1

Package Sidebar

Install

npm i flash-messages-ak

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

16.3 kB

Total Files

9

Last publish

Collaborators

  • kashalo