promptjs

1.2.0 • Public • Published

Prompt

npm npm GitHub

A web app notification plugin to easily integrate and get going.

Prompt

Demo

Documentation:

Install: npm install promptjs --save

Update: npm update promptjs --save

Update to the latest version of the library to catch up with new features.

Usage:

Import:

  1. If you're running this on reactjs/vuejs/angular sort of framework, you can directly use require. Alternatively, if you've browerify or requirejs in your project, you can import directly from node_modules:
require('promptjs')

Don't forget to add the stylesheet:

<link rel="stylesheet" href="/node_modules/promptjs/dist/prompt.css">
  1. If not, copy them to your client side vendor directory like:
cp -r node_modules/promptjs statics/vendor/

where statics is my client side static directory (Yours might have some equivalent name. Add accordingly). And then add these lines to your client side view or html file:

<link rel="stylesheet" href="/static/vendor/promptjs/dist/prompt.css">
<script type="text/javascript" src="/static/vendor/promptjs/dist/prompt.js"></script>

Trigger:

Prompt.create({
    title: "Title",
    text: "Text",
    type: "success",
    position: "top-right",
    timeout: "5000"  // 5s
});

Screenshot:

Screenshot


Contributions Welcome. Feel free to open an issue with a feature request or bug report and work on it. Assign it to yourself so that nobody else takes it up.


Inspired by VanillaToasts.

Package Sidebar

Install

npm i promptjs

Weekly Downloads

6

Version

1.2.0

License

Apache-2.0

Unpacked Size

20.3 kB

Total Files

9

Last publish

Collaborators

  • anistark