All Projects → nstudio → nativescript-snackbar

nstudio / nativescript-snackbar

Licence: Apache-2.0 license
NativeScript plugin for Material Design Snackbar

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
SCSS
7915 projects
shell
77523 projects
Vue
7211 projects
HTML
75241 projects

Projects that are alternatives of or similar to nativescript-snackbar

nativescript-loading-indicator
NativeScript Loading Indicator plugin
Stars: ✭ 48 (+118.18%)
Mutual labels:  nativescript, nstudio
MaterialDesignSample
Android transition元素共享动画、CoordinatorLayout、AppBarLayout、FloatingActionButton、BottomSheet、SnackBar、自定义behavior实现动画效果。
Stars: ✭ 28 (+27.27%)
Mutual labels:  snackbar
nativescript-snackbar
🍭 🍫 NativeScript plugin for Material Design SnackBar
Stars: ✭ 74 (+236.36%)
Mutual labels:  nativescript
nativescript-drawingpad
📝 NativeScript plugin to provide a way to capture any drawing (signatures are a common use case) from the device
Stars: ✭ 89 (+304.55%)
Mutual labels:  nativescript
nativescript-getters
A NativeScript plugin that adds six new getters – in addition to the native "getViewById" method – to retrieve one or more views by tag, type, class, style, value pair or property.
Stars: ✭ 12 (-45.45%)
Mutual labels:  nativescript
flutter examples
Random flutter examples
Stars: ✭ 18 (-18.18%)
Mutual labels:  snackbar
angular2-webpack-advance-starter
An advanced Angular2 Webpack Starter project with support for ngrx/store, ngrx/effects, ng2-translate, angulartics2, lodash, NativeScript (*native* mobile), Electron (Mac, Windows and Linux desktop) and more.
Stars: ✭ 49 (+122.73%)
Mutual labels:  nativescript
denbun
Adjust showing frequency of Android app messages, and to be more user friendly 🐦
Stars: ✭ 17 (-22.73%)
Mutual labels:  snackbar
nativescript-appversion
🔢 NativeScript plugin to retrieve your app's package ID and current version
Stars: ✭ 47 (+113.64%)
Mutual labels:  nativescript
nativescript-textinputlayout
Android Material Design TextInputLayout for NativeScript
Stars: ✭ 35 (+59.09%)
Mutual labels:  nativescript
firebase
Modular Firebase 🔥 implementation for NativeScript. Supports both iOS & Android platforms for all Firebase services.
Stars: ✭ 36 (+63.64%)
Mutual labels:  nativescript
nativescript-star-printer
🌟 Print directly to Star Micronics printers from your NativeScript app! http://www.starmicronics.com/
Stars: ✭ 28 (+27.27%)
Mutual labels:  nativescript
marketplace-feedback
This repository is for feedback regarding NativeScript Marketplace. Use the issues system here to submit feature requests, vote for existing ones or report bugs.
Stars: ✭ 16 (-27.27%)
Mutual labels:  nativescript
nativescript-clipboard
📋 NativeScript plugin to copy stuff to the device clipboard, and read from it again
Stars: ✭ 40 (+81.82%)
Mutual labels:  nativescript
nativescript-yoonit-websocket
Build modern apps using NativeScript and WebSocket in Android and iOS
Stars: ✭ 62 (+181.82%)
Mutual labels:  nativescript
nativescript-vue-examples
🍈 NativeScript and Vue code samples.
Stars: ✭ 13 (-40.91%)
Mutual labels:  nativescript
nativescript-healthcare-app
Healthcare example application built with NativeScript Angular. NativeScript template to quickly prototype your own business idea.
Stars: ✭ 24 (+9.09%)
Mutual labels:  nativescript
nativescript-vue-typescript-seed
Get started using NativeScript and Vue with TypeScript quick and easy
Stars: ✭ 22 (+0%)
Mutual labels:  nativescript
smart-show
Toast # Snackbar # Dialog
Stars: ✭ 500 (+2172.73%)
Mutual labels:  snackbar
ki-snackbar
An easy to use alternative of Android snackbar for iOS.
Stars: ✭ 12 (-45.45%)
Mutual labels:  snackbar

NativeScript-Snackbar 🍭 🍫 🍦

NativeScript plugin for Material Design SnackBar component.

Action Build npm npm


Installation:

NativeScript 7+: tns plugin add @nstudio/nativescript-snackbar

NativeScript version prior to 7: tns plugin add @nstudio/[email protected]

Demo

Snackbar

Usage

TS

import { SnackBar, SnackBarOptions } from "@nstudio/nativescript-snackbar";

// Create an instance of SnackBar
const snackbar = new SnackBar();

/// Show a simple snackbar with no actions
public showSimple() {
    snackbar.simple('Snackbar', 'red', '#fff', 3, false).then((args) => {
         this.set('jsonResult', JSON.stringify(args));
   })
}

/// Show an Action snack bar
public showAction() {
  const options: SnackBarOptions = {
    actionText: this.get('actionText'),
    actionTextColor: '#ff4081',
    snackText: this.get('snackText'),
    textColor: '#346db2',
    hideDelay: 3500,
    backgroundColor: '#eaeaea',
    maxLines: 3, // Optional, Android Only
    isRTL: false,
    view: <View>someView, // Optional, Android Only, default to topmost().currentPage
    padding: number //Optional, iOS only
  };

  snackbar.action(options).then((args) => {
    if (args.command === "Action") {
      this.set('jsonResult', JSON.stringify(args));
    } else {
      this.set('jsonResult', JSON.stringify(args));
    }
  });
}

API

Show a simple SnackBar (color args will only work on Android)

  • simple(snackText: string, textColor?: string, backgroundColor?: string, maxLines?: number, isRTL?: boolean, view?: View): Promise

Show a SnackBar with Action.

  • action(options: SnackBarOptions): Promise

Manually dismiss an active SnackBar

  • dismiss(): Promise

SnackBarOptions Interface

  • actionText: string
  • actionTextColor: string
  • snackText: string
  • hideDelay: number
  • textColor: string
  • backgroundColor: string
  • maxLines: number
  • isRTL: boolean
  • view: View
  • padding: number

Run Demo

git clone https://github.com/nstudio/nativescript-snackbar.git
cd nativescript-snackbar/src
npm run build

npm run demo.ios

// or...

npm run demo.android

Changelog

Contributing

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].