Skip to content

aiserg/react-native-snackbar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-snackbar

Implementation of the material design snacker component. See Google Design

Installation

To use this extension, you have to do the following steps:

  1. In your react-native project, run

    npm install react-native-snackbar
    
  2. Link your library using rpm link (learn more about rnpm) or following react-native doc guide.

  3. Import it in you JS, where you want to show a snacker

    import Snackbar from 'react-native-snackbar' 
    

Usage

To show a simple snackbar simply call:

Snackbar.show({
	title: 'Hello world',
	duration: Snackbar.LENGTH_INDEFINITE, // optional
	// Can be .LENGTH_INDEFINITE | .LENGTH_LONG | LENGTH_SHORT
})

..Preview..

To add an action:

Snackbar.show({
	title: 'Hello world',
	action: {
		title: 'UNDO',
		color: 'green',
		onPress: () => {
			// do something here
		},
	},
})

..Preview..

About

React Native Snackbar for Android & iOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 63.7%
  • Java 27.3%
  • JavaScript 9.0%