1.0.3 • Published 5 years ago

@farzad.zare/snackbar-react-native v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

React Native Snack Bar component.

Material Design "Snack Bar" component for Android and iOS.

demo

Snackbars are used for displaying a brief message to the user, along with an optional action. They animate up from the bottom of the screen and then disappear shortly afterward.

PropsRequiredDefault Value
childrenNo
visibleYesfalse
durationNo3
autoHideNotrue
snackBarTypeNoINFO
buttonVisibleNotrue
buttonStyleNo-
renderButtonNo-
buttonTextYes-
buttonTextStyleNo-
messageTextYes-
messageTextStyleNo-
showAnimDurationNo200
hideAnimDurationNo200
imageVisibleNofalse
sourceNo-
resizeModeNostretch
onPressNo-
onChangeVisibleYes-
useNativeDriverNotrue

Install

npm install --save @farzad.zare/snackbar-react-native

Usage

import SnackBar from "@farzad.zare/snackbar-react-native";

render(){
    return (
        <View
            style={{ flex : 1 }}>
            
            <SnackBar
                onChangeVisible={(visible) => this.setState({visible})}
                visible={this.state.visible}            
                buttonText={"Show Message"}
                messageText={"Message Text"}
                snackBarType={SnackBar.SnackBarType.INFO}
            />

        </View>
    );
};

Custom View Snack Bar

import SnackBar from "@farzad.zare/snackbar-react-native";

render(){
    return (
        <View
            style={{flex : 1}}>
            
            <SnackBar
                onChangeVisible={(visible) => this.setState({visible})}
                visible={this.state.visible}>

                <View>
                    ...
                </View>

            </SnackBar>


        </View>
    );
};

Tags

  • React Native
  • Java Script
  • NodeJs
  • SnackBar
  • iOS
  • Android
  • Message
  • Animate

Support

  • farzad.zare@live.com
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago