0.0.5 • Published 4 years ago

react-native-toast-snackbar v0.0.5

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

react-native-toast-snackbar

📖 Getting started

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

Mostly automatic installation

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

💻 Usage

Only for ANDROID

import { Toast, Snackbar } from 'react-native-toast-snackbar';

// Toast
Toast.show({
	message: 'My Message',
	duration: Toast.LENGTH_SHORT,
});

// Snackbar
Snackbar.show({
	message: 'My Message',
	duration: Snackbar.LENGTH_SHORT,
});

💡 Props

  • Toast.show({})

KeyTypeDefaultdescription
messagestringrequiredThe message to display
durationnumberToast.LENGTH_SHORTHow long to display message
gravitystringundefinedPosition of the toast message
textColorstringundefinedThe color for message text
backgroundColorstringundefinedThe color for toast background

Where duration is:

  1. Toast.LENGTH_SHORT
  2. Toast.LENGTH_LONG

Where gravity is: 'TOP' | 'BOTTOM' | 'LEFT' | 'RIGHT'

  • Snackbar.show({})

KeyTypeDefaultdescription
messagestringrequiredThe message to display
durationnumberSnackbar.LENGTH_SHORTHow long to display message
textColorstring'white'The color of message text
backgroundColorstring'dark gray'The color of snackbar background
actionobjectundefinedThe action button on snackbar
rtlbooleanfalseTo display snackbar right-to-left direction (add android:supportsRtl="true" in manifest file)

Where duration is:

  1. Snackbar.LENGTH_SHORT
  2. Snackbar.LENGTH_LONG
  3. Snackbar.LENGTH_INDEFINITE

Where action is:

KeyTypeDefaultdescription
textstringrequiredThe text for snackbar button
textColorstring'#479ed7'The color of text for button
onPressfunctionundefinedA callback function when user tap on snackbar buton

📜 License

This library is provided under the MIT License

react-native-toast-snackbar @dilipsuthar97

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.3-beta.1

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

1.0.0

4 years ago