sean-perkins / nativescript-confettiview

NativeScript Confetti View.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NativeScript ConfettiView Plugin

npm npm

A NativeScript plugin to create an animated confetti view on iOS and Android.

Getting Started

  • npm install nativescript-confettiview
  • Import the ConfettiView into your page and start confetti!
import {Observable} from 'data/observable';
import {ConfettiView} from 'nativescript-confettiview';

export class HelloWorldModel extends Observable {

  private confettiView: any;

  constructor() {
    super();
    this.confettiView = new ConfettiView();
    this.confettiView.startConfetti();
  }

  public stopConfetti() {
    this.confettiView.stopConfetti();
  }

  public startConfetti() {
    this.confettiView.startConfetti();
  }

}

Note: On first run, you may see a console log regarding an incorrect local file path. Let the install finish and you will notice the package.json will reflect your local file path to the plugin.

Available Functions

Call Signature Default
intensity(number) 0.5
colors(array) UIColor[]
startConfetti()
stopConfetti()

Example

Image

Credits

About

NativeScript Confetti View.

License:Other


Languages

Language:TypeScript 85.2%Language:HTML 9.3%Language:CSS 3.5%Language:Ruby 2.0%