1.2.0 • Published 3 years ago
promptjs v1.2.0
Prompt
A web app notification plugin to easily integrate and get going.
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:
- 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">- 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:
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.