JSPM

@nativescript-community/ui-material-snackbar

7.2.78
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 112
  • Score
    100M100P100Q113317F
  • License Apache-2.0

Material Design Snackbars provide brief messages about app processes at the bottom of the screen.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nativescript-community/ui-material-snackbar) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    NativeScript Material Snackbar

    Material Design's Snackbar component for NativeScript.

    npm npm

    Contents

    1. Installation
    2. Changelog
    3. FAQ
    4. Usage

    Installation

    For NativeScript 7.0+

    • tns plugin add @nativescript-community/ui-material-snackbar

    For NativeScript 6.x

    • tns plugin add nativescript-material-snackbar

    If using tns-core-modules

    • tns plugin add nativescript-material-snackbar@2.5.4

    Be sure to run a new build after adding plugins to avoid any issues.

    Changelog

    FAQ

    Usage

    TypeScript

    import { SnackBar } from '@nativescript-community/ui-material-snackbar';
    
    const snackbar = new SnackBar();
    
    export function showSimpleSnackbar() {
        snackbar.simple(`I'm a simple snackbar`).then(result => console.log('Simple Snackbar:', result));
    }
    
    export function showActionSnackbar() {
        snackbar
            .action({
                message: `I'm a snackbar with an action`,
                actionText: 'Dismiss',
                hideDelay: 2000
            })
            .then(result => console.log('Action Snackbar:', result));
    }
    
    export function showColorfulSnackbar() {
        snackbar
            .action({
                message: `I'm a colorful snackbar`,
                textColor: 'blue',
                actionTextColor: 'yellow',
                backgroundColor: 'green',
                actionText: 'Dismiss',
                hideDelay: 2000
            })
            .then(result => console.log('Action Snackbar:', result));
    }