Socket
Book a DemoInstallSign in
Socket

rn-simple-toast

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rn-simple-toast

React Native Toast component for both iOS and Android

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

rn-simple-toast

React Native Toast component for both iOS and Android

Add it to your project

  • Insall package
    • Using NPM npm i -S rn-simple-toast
    • Using Yarn yarn add rn-simple-toast
  • Import package import { Toast, DURATION, POSTION } from 'rn-simple-toast';

Usage

import React from 'react';
import { Toast, DURATION  } from 'rn-simple-toast';
class App extends React.Component  {
    render() {
        return (
            <View style={styles.container}>
                <Toast ref={_ref => this.toastRef = _ref} />
                <Button
                    onPress={() => {
                        toastRef.show('Some message here', '#3498db', DURATION.LONG);
                    }}
                    title='Show message'
                    style={{ width: 120, backgroundColor: 'darkviolet' }}
                    textColor='#fff'
                />
            </View>
        );
    }
}
DEMO

iOS Android

Props

  • duration (String) - Duration time to display message.
  • containerStyle (String) Style of toast container.
  • textStyle (Function) - Style of text message
  • position (String) - Message display position
  • positionOffset (String) - Distance from top or bottom to display message

Method

  • show - The method to show toast message

MIT Licensed

Keywords

react-native

FAQs

Package last updated on 28 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts