Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@logvinme/react-native-snackbar-component

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@logvinme/react-native-snackbar-component

A snackbar component for Android and iOS

  • 1.1.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

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 @logvinme/react-native-snackbar-component

Basic Usage

import SnackBar from '@logvinme/rreact-native-snackbar-component'

Code

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

Options

PropTypeEffectDefault Value
visiblebooleanShow or hide the snackbarnone
textMessagestring / functionThe main message text, can also supply a function returning JSX to render custom message UInone
actionHandlerfunctionFunction to be called when button is pressed, if absent no action button is shownnone
actionTextmessageThe text of action button, will be uppercased automaticallynone
backgroundColorcolorThe background color of snackbar#484848
accentColorcolorThe color of action button textorange
messageColorcolorThe color of main message text#FFFFFF
distanceCallbackfunctionFunction 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 or top, based on position.(distance) => {}
positionstringThe position of the snackbar: top, bottombottom
top / bottom / left / rightnumberUse these to position the snackbar0
autoHidingTimenumberHow many milliseconds the snackbar will be hidden0 (Do not hide automatically)
containerStyleobjectOverride or add style to the root container View{}
messageStyleobjectOverride or add style to the message Text{}
actionStyleobjectOverride or add style to the action button Text{}

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.

Keywords

FAQs

Package last updated on 29 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc