3.0.0 • Published 4 years ago

react-native-custom-ui-toast v3.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

react-native-custom-ui-toast

A simple custom toast library. (Currently only availabe for android devices)

Getting started

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

Mostly automatic installation

$ react-native link react-native-custom-ui-toast

Example Application

Checkout the GitHub page to get the code of this application

Usage

Import the library in your component by adding this line on top:

import CustomUiToast from 'react-native-custom-ui-toast';

Use showToast method to display a toast:

CustomUiToast.showToast(
    // Toast Message
    "hello world",
    // Toast Duration
    3000,
    // Style Object
    {
        // Toast position
        position: 'bottom',
        // Toast Offset on x-axis
        offsetX: 0,
        // Toast Offset on y-axis
        offsetY: 0,
        // Toast Background color
        backgroundColor: '#000000',
        // Toast Text color
        color: '#ffffff'
    })

Arguments

ArgumentArgument TypeDescription
MessageStringToast Message
DurationNumberToast Duration
StylesObjectToast Styling Object

Styles

StyleStyle TypeDefaultDescription
positionStringbottomToast Position
offsetXNumber0Toast Offset on x-axis
offsetYNumber0Toast Offset on y-axis
backgroundColorString#AAAAAAToast Background Color
colorString#000000Toast Text Color

Positions

PositionDescription
topSet toast position to Top Center
topleftSet toast position to Top Left
toprightSet toast position to Top Right
centerSet toast position to Center
centerleftSet toast position to Center Left
centerrightSet toast position to Center Right
bottomSet toast position to Bottom
bottomleftSet toast position to Bottom Left
bottomrightSet toast position to Bottom Right
3.0.0

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

2.0.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.0

4 years ago