1.0.1 • Published 5 years ago

react-native-message-dialog v1.0.1

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

react-native-message-dialog

A simple, dialog message component with callback action like Airbnb. Ideal for showing errors, info and warnings.

npm.io

Installation

If using npm:

npm i react-native-message-dialog

Usage

import Message from 'react-native-message-dialog'

Simply place a <Message /> inside of any compnent.

<View style={{ flex: 1 }}>
    <Message visible={true} />
</View>

Styling Usage

Message is fully customizable using the height, textStatus, textCb, textMessage, textStatusStyle and textCbStyle props.

Example usage to change dots color:

const textStatusStyle = {
    color: 'red',
};

return (
    <View style={{flex: 1}}>
        <Message visible={true} textStatusStyle={textStatusStyle} />
    </View>
)

Documentation

Message Component

NameDescriptionDefaultType
visibleDeterminates if message container is visiblefalseBoolean
onPressCallback to retry an action() => ({})Function
textStatusLeft text of the message containerErrorString
textCbRight text of the message container (Callback action)RetryString
textMessageCenter text of the message containerPlease try again.String
textStatusStyleStyle to apply to textMessageObjectObject
textCbStyleStyle to apply to textCbObjectObject

Contributing

Pull requests are always welcome! Feel free to open a new GitHub issue for any changes that can be made.

Author

Janid Ham | https://janidham.com

License

MIT