1.2.1 • Published 5 years ago
react-native-cool-snackbar v1.2.1
react-native-cool-snackbar
Snackbar component for React-native
Props
prop | type | required and default |
---|---|---|
message | string | required (no default) |
isActive | bool | required (false) |
duration | oneOf('short','long') | not required (short) |
action | object | not required (no defalut) |
action object when provided should look like
action | type | required |
---|---|---|
title | string | yes |
color | string | yes |
onPress | func | yes |
duration | timing |
---|---|
short (default) | 2200ms |
long | 3500ms |
Example
See this expo snack to see how to use Snackbar
In your render method
<SnackBar
message="Mail sent !"
isActive={true} //conditionally set to true
action={{ //optional
title: 'RESEND',
color: 'green',
onPress: () => console.log('done'),
}}
/>