npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cordova-plugin-snackbar-smooth

v1.0.0

Published

The Snackbar plugin for Cordova provides a smooth and customizable snackbar (toast-like message) to display brief notifications or alerts within your Cordova applications. This plugin allows you to show contextual messages with actions that smoothly appea

Readme

SnackbarSmooth Cordova Plugin

A customizable Snackbar plugin for Cordova that allows you to display interactive Snackbar messages in Android apps with event listeners and full styling control.


Features

  • Display Snackbar notifications with custom messages.
  • Add action buttons that execute JavaScript callbacks.
  • Listen to Snackbar onShow, onDismiss, and onAction Click events.
  • Fully customizable background color, text color, action button color.
  • Assign unique IDs to Snackbars to track events.
  • Compatible with AdMob banners and other overlays.

Installation

cordova plugin add cordova-plugin-snackbar-smooth

Usage

1. Register Event Listeners

cordova.plugin.snackbar.smooth.on('onShow', function(data) {
    console.log('Snackbar Shown:', data.id);
});

cordova.plugin.snackbar.smooth.on('onDismiss', function(data) {
    console.log('Snackbar Dismissed:', data.id);
});

cordova.plugin.snackbar.smooth.on('onAction', function(data) {
    console.log('Snackbar Action Clicked:', data.id);
});

2. Show Snackbar

cordova.plugin.snackbar.smooth.show({
    id: "updateNotice",                   // Optional ID to track this Snackbar
    message: "New version available!",    // Snackbar message text
    actionText: "Update",                 // Text on the action button
    backgroundColor: "#333333",           // Background color of Snackbar
    textColor: "#FFFFFF",                 // Text color of message
    actionTextColor: "#FF4081",           // Text color of action button
    duration: 3000                        // Duration in ms (3000 = 3 seconds)
}, function() {
    console.log("Snackbar displayed successfully");
}, function(err) {
    console.error("Error showing Snackbar:", err);
});

3. Dismiss Snackbar

cordova.plugin.snackbar.smooth.dismiss(function() {
    console.log("Snackbar dismissed");
}, function(err) {
    console.error("Error dismissing Snackbar:", err);
});

API Reference

.show(options, successCallback, errorCallback)

| Parameter | Type | Description | |-----------------|------------|-------------| | options | Object | Snackbar configuration (see below) | | successCallback | Function | Called when Snackbar shows successfully | | errorCallback | Function | Called if an error occurs |

options object:

| Property | Type | Default | Description | |---------------------|------------|--------------|-------------| | id | String | (optional) | Unique ID for tracking Snackbar events | | message | String | (required) | Text message to display | | actionText | String | "" | Text for action button (optional) | | backgroundColor | String | "#323232" | Snackbar background color | | textColor | String | "#FFFFFF" | Message text color | | actionTextColor | String | "#FF4081" | Action button text color | | duration | Number | Snackbar.LENGTH_SHORT | Duration in milliseconds or Snackbar constant |


.dismiss(successCallback, errorCallback)

| Parameter | Type | Description | |----------------------|------------|-------------| | successCallback | Function | Called when Snackbar is dismissed | | errorCallback | Function | Called if an error occurs |


.on(event, callback)

Registers event listeners for Snackbar events.

| Event Name | Trigger | |-------------|--------| | onShow | Snackbar is shown | | onDismiss | Snackbar is dismissed | | onAction | Action button is clicked |

cordova.plugin.snackbar.smooth.on('onShow', function(data) {
    console.log('Snackbar Shown:', data.id);
});

Event Callback Data Structure

Every event callback returns a JSON object:

{
    "event": "onAction",
    "id": "updateNotice",
    "data": "clicked"
}

| Property | Description | |----------|-------------| | event | The event type: "onShow", "onDismiss", "onAction" | | id | The unique ID of the Snackbar (if specified in .show) | | data | Event-specific data ("clicked", "dismissed", etc.) |


Example: Full Integration

document.addEventListener('deviceready', function() {
    cordova.plugin.snackbar.smooth.on('onAction', function(data) {
        if (data.id === "updateNotice") {
            console.log("User clicked update!");
            // Your custom action here
        }
    });

    cordova.plugin.snackbar.smooth.show({
        id: "updateNotice",
        message: "New version available",
        actionText: "Update",
        duration: 5000
    });
});

Compatibility

  • Android Only
  • Cordova >= 8.0.0
  • Requires AndroidX & Material Design dependencies.

License

MIT License.


Author

Buyung Setiawan Purnomo