All Projects → onemolegames → react-native-toast-native

onemolegames / react-native-toast-native

Licence: other
A native and easy to use toast plugin for react-native

Programming Languages

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

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

smart-show
Toast # Snackbar # Dialog
Stars: ✭ 500 (+410.2%)
Mutual labels:  toast
ngx-toasta
Simple and clean Toast notification library for AngularX (Angular2 and beyond)
Stars: ✭ 20 (-79.59%)
Mutual labels:  toast
php-flasher
🔔 Flasher is a powerful and flexible flash notifications system for PHP, Laravel, Symfony
Stars: ✭ 68 (-30.61%)
Mutual labels:  toast
commons
flutter commons package
Stars: ✭ 42 (-57.14%)
Mutual labels:  toast
Toast
To use it in PCL or .NetStandard projects write this line of code : CrossToastPopUp.Current.ShowToastMessage("Message");
Stars: ✭ 51 (-47.96%)
Mutual labels:  toast
iakit
无依赖 mini 组件库,只封装了 alert, toast, loading, actionSheet 等使用频率较高的组件。适用于类似 H5 活动页的简单移动端项目,不必为了使用这些组件而引入一个大而全的 UI 库和框架。
Stars: ✭ 38 (-61.22%)
Mutual labels:  toast
neodigm55
An eclectic low-code vanilla JavaScript UX micro-library for those that defiantly think for themselves.
Stars: ✭ 14 (-85.71%)
Mutual labels:  toast
Razor.SweetAlert2
A Razor class library for interacting with SweetAlert2
Stars: ✭ 98 (+0%)
Mutual labels:  toast
v-tostini
Toast plugin for Vue.js 2.x
Stars: ✭ 12 (-87.76%)
Mutual labels:  toast
react-native-toastify
📱 React Native cross-plateform (iOS / Android) Toast component highly customizable.
Stars: ✭ 32 (-67.35%)
Mutual labels:  toast
Toast-for-Framework7
A toast component plugin for iOS Framework7
Stars: ✭ 41 (-58.16%)
Mutual labels:  toast
ktx
简化Android开发的Kotlin库
Stars: ✭ 39 (-60.2%)
Mutual labels:  toast
react-toast
Minimal toast notifications for React.
Stars: ✭ 47 (-52.04%)
Mutual labels:  toast
ToastUtils
Android Toast,即便关闭了通知权限也会正常显示 (暂停维护)
Stars: ✭ 33 (-66.33%)
Mutual labels:  toast
EasyToast
Swift Toasts Library
Stars: ✭ 20 (-79.59%)
Mutual labels:  toast
denbun
Adjust showing frequency of Android app messages, and to be more user friendly 🐦
Stars: ✭ 17 (-82.65%)
Mutual labels:  toast
toast-swift
A Swift Toast view - iOS 14 style and newer - built with UIKit. 🍞
Stars: ✭ 85 (-13.27%)
Mutual labels:  toast
vue-message
A prompt component based on vue2.0
Stars: ✭ 37 (-62.24%)
Mutual labels:  toast
BalloonPopup
Forget Android Toast! BalloonPopup displays a round or squared popup and attaches it to a View, like a callout. Uses the Builder pattern for maximum ease. The popup can automatically hide and can persist when the value is updated.
Stars: ✭ 32 (-67.35%)
Mutual labels:  toast
JDToaster
🍞 Toasty iOS alerts
Stars: ✭ 25 (-74.49%)
Mutual labels:  toast

StackShare

react-native-toast-native

React Native Toast is a toast component for both Android and iOS. it uses scalessec/Toast for iOS;

Demo:

Getting started

$ npm install react-native-toast-native --save

Mostly automatic installation

$ react-native link react-native-toast-native

Manual installation

iOS (CocoaPods)

Add the following to your podfile:

pod 'RNToastNative', :path => '../node_modules/react-native-toast-native/ios`

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-toast-native and add RNToastNative.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNToastNative.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.toast.RCTToastPackage; to the imports at the top of the file
  • Add new RCTToastPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-toast-native'
    project(':react-native-toast-native').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-toast-native/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
        compile project(':react-native-toast-native')
    

Usage

It's just the same as ToastAndroid

import Toast from 'react-native-toast-native';

Toast.show(); // Default toast message is shown.
Toast.show('This is a toast.'); // Specific message is shown with default duration("SHORT") and poistion("TOP") and styles.
Toast.show('This is a long toast.',Toast.LONG); //Specific message and duration are shown with default position and styles.

It is higly customasible. Just provide a style object as a parameter. example:

import Toast from 'react-native-toast-native';
 const styles={
                 width,
                 height,
                 backgroundColor,
                 color,
                 borderWidth,
                 borderColor,
                 borderRadius
 }
 
 Toast.show('This is a long toast.',Toast.SHORT,Toast.TOP,styles); 
 // Customizable toast message is shown with specific message,duration and position.

Options

You can style the toast with below options; Android:

{
              width,
              height,
              backgroundColor,
              color,
              borderWidth,
              paddingLeft,
              paddingRight,
              paddingBottom,
              paddingTop,
              fontSize,
              lineHeight,
              xOffset,
              yOffset,
              letterSpacing,
              fontWeight
}

Ios:

  {
                  width,
                  height,
                  backgroundColor,
                  color,
                  borderWidth,
                  borderColor,
                  borderRadius
  }
  

if you want to make a customizable toast,you add an object like above to show and showGravity

Example usage:

import Toast from 'react-native-toast-native';
import {Platform} from 'react-native';
const style={
                             backgroundColor: "#4ADDFB",
                             width: 300,
                             height: Platform.OS === ("ios") ? 50 : 100,
                             color: "#ffffff",
                             fontSize: 15,
                             lineHeight: 2,
                             lines: 4,
                             borderRadius: 15,
                             fontWeight: "bold",
                             yOffset: 40
                         };
  Toast.show(message, Toast.SHORT, Toast.TOP,style);
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].