All Projects → hyperjumptech → react-native-confetti

hyperjumptech / react-native-confetti

Licence: other
React Native component to show confetti

Programming Languages

typescript
32286 projects
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language
java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language
Starlark
911 projects

Projects that are alternatives of or similar to react-native-confetti

SPConfetti
Show the confetti only when the user is having fun, and if not having fun, don't show it.
Stars: ✭ 187 (+306.52%)
Mutual labels:  confetti, confetti-animation
Canvas Confetti
🎉 on-demand confetti gun
Stars: ✭ 2,394 (+5104.35%)
Mutual labels:  confetti, snow
awesome.id
😎 🇮🇩 Awesome Indonesia: Daftar produk, proyek, acara dan sumber daya lainnya yang dibuat oleh developer dan founder dari Indonesia.
Stars: ✭ 189 (+310.87%)
Mutual labels:  indonesia
bellshade-website
Repositori untuk web organisasi bellshade
Stars: ✭ 56 (+21.74%)
Mutual labels:  indonesia
CPP
Repositori untuk belajar pemrograman C++ dalam bahasa Indonesia
Stars: ✭ 27 (-41.3%)
Mutual labels:  indonesia
flarum-ext-indonesian
Indonesian Language Pack for Flarum
Stars: ✭ 13 (-71.74%)
Mutual labels:  indonesia
react-canvas-confetti
React component for canvas-confetti library
Stars: ✭ 120 (+160.87%)
Mutual labels:  confetti
EasyConfetti
🎊 Fancy confetti effects in Swift
Stars: ✭ 557 (+1110.87%)
Mutual labels:  confetti
confetty
Confetti in your TTY
Stars: ✭ 218 (+373.91%)
Mutual labels:  confetti
reinforcement-learning-resources
A curated list of awesome reinforcement courses, video lectures, books, library and many more.
Stars: ✭ 38 (-17.39%)
Mutual labels:  indonesia
Dart
Repositori untuk belajar pemrograman Dart dalam bahasa Indonesia
Stars: ✭ 22 (-52.17%)
Mutual labels:  indonesia
gramatika.app
Website of Gramatika check spelling and typo tools in Bahasa Indonesia
Stars: ✭ 72 (+56.52%)
Mutual labels:  indonesia
react-snowfetti
Generates random particles using html5 canvas API.
Stars: ✭ 17 (-63.04%)
Mutual labels:  confetti
bot-line-indonesian-summarizer
Tugas NLP UB Filkom 2017
Stars: ✭ 20 (-56.52%)
Mutual labels:  indonesia
js-confetti
JS Confetti library that supports emojis 🦄 🎉 ⚡️
Stars: ✭ 343 (+645.65%)
Mutual labels:  confetti
kodepos
📮 Indonesian postal code search API by place name, village or city.
Stars: ✭ 32 (-30.43%)
Mutual labels:  indonesia
Tsparticles
tsParticles - Easily create highly customizable particles animations and use them as animated backgrounds for your website. Ready to use components available for React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Solid, Riot and Web Components.
Stars: ✭ 2,694 (+5756.52%)
Mutual labels:  confetti
kulgram
Kulgram Laravel Indonesia.
Stars: ✭ 36 (-21.74%)
Mutual labels:  indonesia
Python
Repositori untuk belajar pemrograman Python dalam bahasa Indonesia
Stars: ✭ 79 (+71.74%)
Mutual labels:  indonesia
RecreatingiMessageConfetti
An Xcode Playground to show the internals of iMessage's Confetti implementation.
Stars: ✭ 29 (-36.96%)
Mutual labels:  confetti

Build Status Build Status License contributions welcome

Introduction

React native component to show confetti. It can be used as raining snow effect animation, with option to use unicode, emoji, or image as the flying pieces.

This is some example

snow effect

(the animation is not lagging. it's because you need to wait for the gif asset to load)

shake effect

(the animation is not lagging. it's because you need to wait for the gif asset to load)

Getting Started

Dependencies

To be able to dynamically enable confetti or to change the character, your react native app must:

  1. Install react-native-firebase (the Core module and Remote Config module)

  2. Set up your app to use Firebase

  3. Create 5 parameters with value of string in your project's remote config:

    parameter example value description
    confetti_enabled 1 set 1 to enable, set 0 to disable
    confetti_image_name snowflake if it has value, the flying piece of the Confetti will use this parameter instead of confetti_character. if you want to use character instead, set this parameter to empty string. Further explanation in using image will be given in next section
    confetti_character set this value with any character or unicode / emoji. eg: ❅, ❤️, 🏮. if parameter confetti_image_name is not empty string, this parameter is not being used
    confetti_type shake set the value shake or snow. With snow, you just use vertical falling animation. With shake you get additional horizontal shake animation.
    confetti_color #6FC4C7 hexadecimal value string

Installation process

Using npm:

npm i @hyperjumptech/react-native-confetti --save

or using yarn:

yarn add @hyperjumptech/react-native-confetti

Usage

Minimal usage

import package

import {Confetti} from '@hyperjumptech/react-native-confetti';

then put the component inside render

<Confetti isEnabled={true} color={'#6FC4C7'} character={'❅'} />

With firebase remote config usage

import package

import {
  Confetti,
  fetchConfettiFromFirebase,
} from '@hyperjumptech/react-native-confetti';

define state to hold the parameters

state = {
  confetti: {
    confetti_type: 'snow',
    confetti_color: '',
    confetti_character: '',
    confetti_image_name: '',
    confetti_enabled: false,
  },
};

define the parameters and call function to get data from firebase remote config

const keys = [
  'confetti_type',
  'confetti_color',
  'confetti_character',
  'confetti_enabled',
  'confetti_image_name',
];

fetchConfetti(keys).then((data) => {
  const confetti = {
    confetti_type: data.confetti_type,
    confetti_color: data.confetti_color,
    confetti_character: data.confetti_character,
    confetti_enabled: data.confetti_enabled === '1' ? true : false,
    confetti_image_name: data.confetti_image_name,
  };
  this.setState({confetti});
});

then put component inside render

const {confetti} = this.state;

return (
  <Confetti
    isEnabled={confetti.confetti_enabled}
    color={confetti.confetti_color}
    character={confetti.confetti_character}
    effect={confetti.confetti_type}
  />
);

Usage with image instead of character

If you wish to use image, you can use image from predefined asset (not a dynamic url). So the step is same as above with additional step to define image path and size:

const images = {
  snowflake: {
    path: require('../../path_to_snowflake_image_asset.png'),
    size: 24,
  },
  heart: {
    path: require('../../path_to_heart_image_asset.jpeg'),
    size: 24,
  },
};

then add the imageComponent props

<Confetti
  ...
  imageComponent={
  !!confetti.confetti_image_name ? (
    <Image
      source={images[confetti.confetti_image_name].path}
      style={{
        width: images[confetti.confetti_image_name].size,
        height: images[confetti.confetti_image_name].size,
      }}
    />
  ) : (
    undefined
  )
}
/>

API references

Props:

props type required description
isEnabled boolean yes to enable or disable the confetti
color string yes define color of character. If you use emoji or image, the color will have no effect even if it has value
character string no the flying pieces. default character is snowflake . you can use any unicode character or emoji. if there is imageComponent this props will have no effect even if it has value
imageComponent ReactNode no the flying pieces (will override character props) in form of react component for example: Image
effect enum: [snow, shake] yes snow to get only vertical falling animation , shake to get additional horizontal shaking animation

Build and Test

To build, run npm run build or yarn build

To test, run npm run test or yarn test

Demo

To see the running demo, you can run the example app with these steps:

  1. change directory to example
cd example
  1. install packages
yarn

or

npm install
  1. run android
react-native run-android

or run ios

react-native run-ios
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].