choo-notifications

2.0.3 • Public • Published

choo-notifications

simple html notifications for choo. Notifications have fixed positions and a high z-index... Notifications descend down the page and disappear after a specific timeout.

usage

In your main file...

app.use(require('choo-notifications'))

Within views...

<div id="example-view">
  ${state.render_notifications()}
</div>

Method: emit('notification', message, colour, timeout)

Trigger a notification from anywhere!

emit('notification', 'hello world!', 'orange')

message (type: String)

The notification message.

colour (type: String) (optional)

Must be a tachyon colour (String)... eg.

  • red
  • green
  • orange

timeout (type: Integer) (optional)

A timeout in seconds before the notification disappears.

example

Check out the example application /example...

cd ./example
npm i
npm run build
npm start

Then visit localhost:8000 (needs python)

screenshot

install

npm i choo-notifications --save

Readme

Keywords

Package Sidebar

Install

npm i choo-notifications

Weekly Downloads

48

Version

2.0.3

License

MIT

Unpacked Size

471 kB

Total Files

14

Last publish

Collaborators

  • yaus