https://github.com/TobiasHennig/nativescript-toast
A NativeScript Toast Plugin for Android and iOS apps.
https://github.com/TobiasHennig/nativescript-toast
Last synced: 12 days ago
JSON representation
A NativeScript Toast Plugin for Android and iOS apps.
- Host: GitHub
- URL: https://github.com/TobiasHennig/nativescript-toast
- Owner: TobiasHennig
- License: mit
- Created: 2015-07-29T20:54:38.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-06-03T14:03:33.000Z (over 4 years ago)
- Last Synced: 2025-10-25T06:59:11.998Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 2.41 MB
- Stars: 67
- Watchers: 2
- Forks: 19
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nativescript - Toast - A NativeScript Toast Plugin for Android and iOS apps. (Awesome {N} [](https://github.com/sindresorhus/awesome) / Table of Contents)
README
# NativeScript Toast Plugin
[](https://travis-ci.org/TobiasHennig/nativescript-toast)
[](http://badge.fury.io/js/nativescript-toast)
[](https://www.npmjs.com/package/nativescript-toast)
[](https://www.npmjs.com/package/nativescript-toast)
> A NativeScript Toast Plugin for Android and iOS apps.
[](https://nodei.co/npm/nativescript-toast/)
## What is a toast?
> A toast provides simple feedback about an operation in a small popup. It only fills the amount of space required for the message and the current activity remains visible and interactive. - [Android Developer](http://developer.android.com/guide/topics/ui/notifiers/toasts.html)

## Demo
How to install and use this plugin? Watch it on [YouTube](https://www.youtube.com/watch?v=2RWtX4crzyE)!
Want simple example application to play with? [nativescript-toast-example](https://github.com/TobiasHennig/nativescript-toast-example)
## Installation
Run the following command from the root of your project:
```
$ tns plugin add nativescript-toast
```
Or the develop version, which may **not work** completly:
```
$ tns plugin add nativescript-toast@next
```
## Usage
```js
var Toast = require("nativescript-toast");
// ...
var toast = Toast.makeText("Hello World");
toast.show();
```
Or via import:
```js
import * as Toast from 'nativescript-toast';
// ...
var toast = Toast.makeText("Hello World");
toast.show();
```
It is also possible to chain the methods.
```js
Toast.makeText("Hello World").show();
```
Pass `"long"` to the `makeText` function to show the toast a bit longer.
```js
Toast.makeText("Hello World", "long").show();
```
## Development
* Android SDK
* Xcode 8+
[](http://badge.fury.io/js/nativescript-toast)