tsonevn / nativescript-toasty

:bread: NativeScript toast plugin :bread:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NativeScript-Toasty

npm npm

Install

tns plugin add nativescript-toasty

Usage

TypeScript

import { Toasty } from 'nativescript-toasty';
const toast = new Toasty('Toast message');
toast.show();

// you can also chain the methods together and there's no need to create a reference to the Toasty instance with this approach
new Toasty('Some Message').setToastDuration(ToastDuration.LONG).show();

// or you can set the properties of the Toasty instance
const toasty = new Toasty('Somethign something...');
toasty.position = ToastPosition.CENTER;
toasty.duration = ToastDuration.SHORT;
toasty.show();

JavaScript

var toasty = require('nativescript-toasty').Toasty;
var toast = new toasty('Toast message');
toast.show();

API

 constructor(
    text: string,
    duration?: ToastDuration,
    position?: ToastPosition
  )

  /**
   * Show the Toasty
   */
  show();

  /**
   * Cancels the Toasty
   */
  cancel();

/**
 * Sets the Toast position.
 */
  setToastPosition(value: ToastPosition): Toasty;


/**
 * Sets the Toast duration.
 */
  setToastDuration(value: ToastDuration: Toasty);
export enum ToastDuration {
  'SHORT',
  'LONG'
}

export enum ToastPosition {
  'BOTTOM',
  'CENTER',
  'TOP'
}

About

:bread: NativeScript toast plugin :bread:

License:Other


Languages

Language:TypeScript 50.0%Language:JavaScript 49.7%Language:Ruby 0.2%