npm.io
1.0.3 • Published 7 years ago

tape-alert

Licence
MIT
Version
1.0.3
Deps
0
Size
28 kB
Vulns
0
Weekly
0

Tape Logo

tape-alert

Simple inline alerts

Tape

Requirements

jQuery >= v2.1.0

Installation

CSS:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tape-alert/dist/tape-alert.css">

JS:

<script src="https://cdn.jsdelivr.net/npm/tape-alert/dist/tape-alert.jquery.js"></script>

Usage

The tape-alert append the alerts in a given container.

<div id="errors"></div>
<div id="warnings"></div>
$('#errors').tape({
    title: 'Error',
    text: ['Required fields are empty'],
    status: 'error',
});

$('#warnings').tape({
    title: 'This is a Warning!',
    text: ['You have 2 minutes to complete the form'],
    status: 'warning',
});

Options

{
    title: '',
    text: '', // Use string or array
    status: '' // error, success, info, warning. Default: error
}

Todo

  • Delay to hide the tape.
  • Custom classes.

Credits