Giter Site home page Giter Site logo

react-native-snackbar-component's Introduction

React-Native-SnackBar-Component

A snackbar component for Android and iOS, customizable and simple.

Snackbar demo With fab

See Google Material Design for more info on Snackbars.

Installation

npm install --save react-native-snackbar-component

Basic Usage

import SnackBar from 'react-native-snackbar-component'

Code

<SnackBar visible={true} textMessage="Hello There!" actionHandler={()=>{console.log("snackbar button clicked!")}} actionText="let's go"/>

Options

Prop Type Effect Default Value
visible boolean Show or hide the snackbar none
textMessage string The main message text none
actionHandler function Function to be called when button is pressed, if absent no action button is shown none
actionText message The text of action button, will be uppercased automatically none
backgroundColor color The background color of snackbar #484848
accentColor color The color of action button text orange
messageColor color The color of main message text #FFFFFF
distanceCallback function Function to be caled whenever snackbar moves in and out or changes layout, the function will be supplied a number indicating distance taken up by snackbar on bottom. (distance) => {}
bottom number The starting bottom position of snackbar 0
position string The position of the snackbar: top, bottom bottom

Note

  • When visible prop is changed, the snackbar will be animated in/out of screen
  • The snackbar will not auto-dismiss by itself, for auto-dismiss use setTimeout() and change value passed to prop to false.
  • This works great together with react-native-fab. See demo for example and instructions how to.

react-native-snackbar-component's People

Contributors

sidevesh avatar spoeck avatar wkuipers avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.