How To Style Navigation Drawer React Navigation V5

[Solved] How To Style Navigation Drawer React Navigation V5 | Actionscript - Code Explorer | yomemimo.com
Question : CSS for Drawer Navigation In React Native

Answered by : eric-tam

const Drawer = createDrawerNavigator();
function MyDrawer() { return ( <Drawer.Navigator useLegacyImplementation screenOptions={{ drawerStyle: { backgroundColor: 'red', width: 240, }, }} > <Drawer.Screen name="Feed" component={Feed} /> <Drawer.Screen name="Article" component={Article} /> </Drawer.Navigator> );
}
function App() { return ( <NavigationContainer> <MyDrawer /> </NavigationContainer> );
}
export default App;

Source : | Last Update : Mon, 03 Oct 22

Question : how to style navigation drawer react navigation v5

Answered by : lucas-bueno

import * as React from 'react';
import { View, Text, StyleSheet, useWindowDimensions, Button,
} from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { Feather } from '@expo/vector-icons';
import { createStackNavigator } from '@react-navigation/stack';
import { createDrawerNavigator, DrawerContentScrollView, DrawerItemList, DrawerItem,
} from '@react-navigation/drawer';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
const Drawer = createDrawerNavigator();
const Tab = createBottomTabNavigator();
const Stack = createStackNavigator();
function TabNav() { return ( <Tab.Navigator> <Tab.Screen name="TabOne" component={() => ( <View style={styles.container}> <Text>TabOne</Text> </View> )} /> <Tab.Screen name="TabTwo" component={() => ( <View style={styles.container}> <Text>TabTwo</Text> </View> )} /> </Tab.Navigator> );
}
const StackNav = () => { return ( <Stack.Navigator> <Stack.Screen name="Feed" component={Feed} /> <Stack.Screen name="Article" component={Article} /> </Stack.Navigator> );
};
function CustomDrawerContent(props) { const width = useWindowDimensions().width * 0.3; return ( <DrawerContentScrollView {...props}> <View style={styles.menuContainer}> <View style={[ styles.menuItemsCard, { backgroundColor: '#fff2df', width: width, height: width }, ]}> <> <View style={[styles.circleContainer, { backgroundColor: '#FFC56F' }]}> <Feather travel name="briefcase" size={25} color="#fbae41" /> <DrawerItem label="Screen1" labelStyle={{ color: '#fbae41', fontSize: 10 }} onPress={() => { props.navigation.navigate('Screen1'); }} /> </View> </> <DrawerItem style={{ position: 'absolute', left: 0, width: width, height: width, }} label="Screen2" labelStyle={{ color: '#609806' }} onPress={() => { props.navigation.navigate('Screen1'); }} /> </View> <View style={[ styles.menuItemsCard, { backgroundColor: '#EFFFD5', width: width, height: width }, ]}> <View style={[styles.circleContainer, { backgroundColor: '#b5ff39' }]}> <Feather Medical name="briefcase" size={25} color="#609806" /> </View> <DrawerItem style={{ position: 'absolute', left: 0, width: width, height: width, }} label="Screen2" labelStyle={{ color: '#609806' }} onPress={() => { props.navigation.navigate('StackNav'); }} /> </View> </View> </DrawerContentScrollView> );
}
function MyDrawer() { return ( <Drawer.Navigator drawerContent={(props) => <CustomDrawerContent {...props} />}> <Drawer.Screen name="Screen1" component={StackNav} /> <Drawer.Screen name="StackNav" component={TabNav} /> </Drawer.Navigator> );
}
export default function App() { return ( <NavigationContainer> <MyDrawer /> </NavigationContainer> );
}
function Feed({ navigation }) { return ( <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <Text>Feed Screen</Text> <Button title={'Article'} onPress={() => navigation.navigate('Article')} /> </View> );
}
function Article({ navigation }) { return ( <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <Text>Article Screen</Text> <Button title={'Feed'} onPress={() => navigation.navigate('Feed')} /> </View> );
}
const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', }, menuContainer: { flex: 1, flexDirection: 'row', justifyContent: 'space-evenly', }, menuItemsCard: { flexDirection: 'column', justifyContent: 'center', alignItems: 'center', borderRadius: 10, }, circleContainer: { width: 50, height: 50, borderRadius: 25, padding: 10, },
});

Source : https://stackoverflow.com/questions/65573511/custom-drawer-in-react-navigation | Last Update : Fri, 14 Jan 22

Question : navigation drawer with navigation component

Answered by : outrageous-oryx-oekk168h4pxl

Link Below

Source : https://www.google.com/search?q=navigation+drawer+with+navigation+component+android&ei=khGYY5T3B8OKzgPCl7LQCg&oq=navigation+drawer+with+navigation+component+&gs_lcp=Cgxnd3Mtd2l6LXNlcnAQARgBMgUIABCABDIFCAAQgAQyBQgAEIAEMgUIABCGAzIFCAAQhgM6CggAEEcQ1gQQsANKBAhBGABKBAhGGABQeVh5YNkSaAFwAXgAgAHqAYgB6gGSAQMyLTGYAQCgAQHIAQjAAQE&sclient=gws-wiz-serp#fpstate=ive&vld=cid:44e70afa,vid:2ywCBCkHtDY | Last Update : Tue, 20 Dec 22

Answers related to how to style navigation drawer react navigation v5

Code Explorer Popular Question For Actionscript