0.0.5 • Published 5 years ago

kami-flash v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

<kami-flash>

A simple flash component. DEMO

Installation

npm install --save kami-flash

Or grab from the dist folder :

<script src="KamiFlash.umd.js"></script>

Usage

<script src="../dist/KamiFlash.umd.js"></script>
<script>
    window.onload = function(){
        customElements.define('flash-exemple', KamiFlash);
    }
</script>

Or:

// ES6 Modules or TypeScript
import KamiFlash from 'kami-flash'

// register the component with the name you want
window.customElements.define('kami-flash', KamiFlash);

Examples

Just add into your html the flash component like this. See the props section to customize your flash component.

<!-- Generate an error message with the text 'An error message !'-->
<flash-exemple
    type="ERROR"
    message="An error message !"
>
</flash-exemple>

Props

nametypedescriptionrequireddefault value
typeTypeThe flash typefalseOK
messageStringThe flash messagefalse'Write your message flash here'
positionPositionThe flash positionfalseBOTTOM
stackBooleanStack or not all flashfalsetrue
timeNumberTime to wait before remove the flashfalsenull
progressbarBooleanDisplay a progress bar if time is setfalsefalse

Contribute

We would love you for the contribution to kami-flash project, check the CONTRIBUTING file for more info.