1.0.5 • Published 4 months ago

react-native-drawer-ui v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

Install:

npm install react-native-drawer-ui

Library only uses pure react native tags without native ios, android dependencies (solution for @react-navigation/drawer installation error)

import React from 'react'
import { Dimensions, Text, View } from 'react-native'
import DrawerLayout from './index'
import { createStackNavigator } from '@react-navigation/stack'

const { Screen, Navigator } = createStackNavigator()

export function App() {
    return (
        <DrawerLayout
            ref={ref => DrawerLayout._ref(ref)}
            renderDrawerContent={() => (
                <DrawerContent />
            )}
            drawerWidth={Dimensions.get('screen').width * 0.75}>
            <Navigator screenOptions={{ headerShown: false }}>
                <Screen component={BottomHome} name={'BottomHome'} />
                <Screen component={Menu} name={'Menu'} />
            </Navigator>
        </DrawerLayout >
    )
}


export default function DrawerApp() {
    return (
        <Navigator screenOptions={{ headerShown: false }}  >
            <Screen name='App' component={App} />
        </Navigator>
    )
}

function Menu() {
    return (
        <View>
            <Text>Menu</Text>
        </View>
    )
}
function DrawerContent() {
    return (
        <View>
            <Text>DrawerContent</Text>
        </View>
    )
}
function BottomHome() {
    return (
        <View>
            <Text>BottomHome</Text>
        </View>
    )
}

Props:

PropDescription
childrenReactNode
drawerBackgroundColorstring
drawerLockMode'unlocked' , 'locked-closed' , 'locked-open'
drawerPosition'left' , 'right'
drawerWidthnumber
keyboardDismissMode'none' , 'on-drag'
onDrawerCloseFunction
onDrawerOpenFunction
onDrawerSlideFunction
onDrawerStateChangedFunction
renderDrawerContentJSX.Element
statusBarBackgroundColorstring
useNativeAnimationsboolean

Refs:

PropDescription
openFunction
closeFunction
1.0.5

4 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago