Skip to content

uutarou10/react-native-snack

Repository files navigation

react-native-snack

Simple snackbar component for React Native.

Features

  • TypeScript support!
  • iOS(include iPhoneX) & Android support!
  • No native modules. You can use without react-native link command.
  • Customizable

ScreenShots

screen record

Usage

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!'});

Options

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

About

Snackbar component for React Native

Resources

License

Stars

Watchers

Forks

Packages

No packages published