Skip to content

DraggableView is a component for react-native, it allows you have a vertical draggable drawer view that you can drag up or drag down. So, if you drag and release that component, then it keeps moving until reach either initial position or container border.

License

Notifications You must be signed in to change notification settings

mesandigital/react-native-draggable-view

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-draggable-view

DraggableView is a component for react-native, it allows you have a vertical draggable view that you can drag up or drag down. So, if you drag and release that component, then it keeps moving until reach either initial position or container border.

Example

react-native-draggable-view

Installation

$ npm i react-native-draggable-view --save

Usage

    <Drawer
        initialDrawerSize={0.09}
        renderContainerView={() => (
            <Screen2 navigation={this.props.navigation} />
        )}
        renderDrawerView={() => (
            <Screen3 navigation={this.props.navigation} />
        )}
        renderInitDrawerView={() => (
            <View style={{ backgroundColor: 'white', height: 66 }}>
                <StatusBar hidden={true} />
                <CartHeader />
            </View>
        )}
    />

Properties

Prop Default Type Description
onDragDown undefined function If you pass a function as parameter it will be notified when the user drag down the drawer
onRelease undefined function If you pass a function as parameter it will be notified when the user release the drawer after drag it
initialDrawerSize 0.0 number It's the initial position or size for Drawer component. If drawer size is 1 that means its using 100% of avalaible space on the screen
isInverseDirection false boolean Allows to use the draggable view in the inverse direction. Which means from the top to the bottom. By default is from the bottom to the top.
renderContainerView undefined View Pass as parameter a renderable react component to show as container.
renderDrawerView undefined View Pass as parameter a renderable react component to show as drawer.
renderInitDrawerView undefined View Pass as parameter a renderable react component to show as view can draggable
finalDrawerHeight 0 number The height position that the drawer will stop starting from top. Example: finalDrawerHeight={100} will stop the drawer at 100 pixels from reaching the top.

About

DraggableView is a component for react-native, it allows you have a vertical draggable drawer view that you can drag up or drag down. So, if you drag and release that component, then it keeps moving until reach either initial position or container border.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 80.7%
  • Objective-C 11.4%
  • Python 4.5%
  • Java 3.4%