Simple snackbar component for React Native.
- TypeScript support!
- iOS(include iPhoneX) & Android support!
- No native modules. You can use without
react-native link
command. - Customizable
Install library.
$ npm i --save react-native-snack
or
$ yarn add react-native-snack
Import library.
import {Snackbar} from 'react-native-snack';
Insert snackbar component to your view root.
<View>
{/* Your application component... */}
<Snackbar />
</View>
And, call Snackbar.show()
.
Snackbar.show({message: 'Hello world!'});
type | default value | description | |
---|---|---|---|
message | string(required) | display message | |
textColor | string(optional) | white | text color |
backgroundColor | string(optional) | gray | snackbar color |
duration | number(optional) | 2000 | display time(msec) |
onCompletedShow | function(optional) | undefined | callback on display completion |
onCompletedHide | function(optional) | undefined | callback on hide completion |