Page Not Found
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
diff --git a/404.html b/404.html index f7011446fce..1c93644df71 100644 --- a/404.html +++ b/404.html @@ -16,8 +16,8 @@ - - + +
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
backBehavior
",id:"backbehavior",level:4},{value:"defaultStatus
",id:"defaultstatus",level:4},{value:"detachInactiveScreens
",id:"detachinactivescreens",level:4},{value:"drawerContent
",id:"drawercontent",level:4},{value:"Providing a custom drawerContent
",id:"providing-a-custom-drawercontent",level:5},{value:"Options",id:"options",level:3},{value:"title
",id:"title",level:4},{value:"lazy
",id:"lazy",level:4},{value:"drawerLabel
",id:"drawerlabel",level:4},{value:"drawerIcon
",id:"drawericon",level:4},{value:"drawerActiveTintColor
",id:"draweractivetintcolor",level:4},{value:"drawerActiveBackgroundColor
",id:"draweractivebackgroundcolor",level:4},{value:"drawerInactiveTintColor
",id:"drawerinactivetintcolor",level:4},{value:"drawerInactiveBackgroundColor
",id:"drawerinactivebackgroundcolor",level:4},{value:"drawerItemStyle
",id:"draweritemstyle",level:4},{value:"drawerLabelStyle
",id:"drawerlabelstyle",level:4},{value:"drawerContentContainerStyle
",id:"drawercontentcontainerstyle",level:4},{value:"drawerContentStyle
",id:"drawercontentstyle",level:4},{value:"drawerStyle
",id:"drawerstyle",level:4},{value:"drawerPosition
",id:"drawerposition",level:4},{value:"drawerType
",id:"drawertype",level:4},{value:"drawerHideStatusBarOnOpen
",id:"drawerhidestatusbaronopen",level:4},{value:"drawerStatusBarAnimation
",id:"drawerstatusbaranimation",level:4},{value:"overlayColor
",id:"overlaycolor",level:4},{value:"sceneContainerStyle
",id:"scenecontainerstyle",level:4},{value:"gestureHandlerProps
",id:"gesturehandlerprops",level:4},{value:"swipeEnabled
",id:"swipeenabled",level:4},{value:"swipeEdgeWidth
",id:"swipeedgewidth",level:4},{value:"swipeMinDistance
",id:"swipemindistance",level:4},{value:"keyboardDismissMode
",id:"keyboarddismissmode",level:4},{value:"freezeOnBlur
",id:"freezeonblur",level:4},{value:"popToTopOnBlur
",id:"poptotoponblur",level:4},{value:"Header related options",id:"header-related-options",level:3},{value:"header
",id:"header",level:4},{value:"Specify a height
in headerStyle
",id:"specify-a-height-in-headerstyle",level:5},{value:"headerShown
",id:"headershown",level:4},{value:"Events",id:"events",level:3},{value:"drawerItemPress
",id:"draweritempress",level:4},{value:"Helpers",id:"helpers",level:3},{value:"openDrawer
",id:"opendrawer",level:4},{value:"closeDrawer
",id:"closedrawer",level:4},{value:"toggleDrawer
",id:"toggledrawer",level:4},{value:"jumpTo
",id:"jumpto",level:4},{value:"Hooks",id:"hooks",level:3},{value:"useDrawerProgress
",id:"usedrawerprogress",level:4},{value:"useDrawerStatus
",id:"usedrawerstatus",level:4},{value:"Nesting drawer navigators inside others",id:"nesting-drawer-navigators-inside-others",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",h5:"h5",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.p,{children:"Drawer Navigator renders a navigation drawer on the side of the screen which can be opened and closed via gestures."}),"\n",(0,t.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,loop:!0,children:(0,t.jsx)("source",{src:"/assets/7.x/drawer.mp4"})}),"\n",(0,t.jsxs)(n.p,{children:["This wraps ",(0,t.jsx)(n.a,{href:"/docs/7.x/drawer-layout",children:(0,t.jsx)(n.code,{children:"react-native-drawer-layout"})}),". If you want to use the drawer without React Navigation integration, use the library directly instead."]}),"\n",(0,t.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,t.jsxs)(n.p,{children:["To use this navigator, ensure that you have ",(0,t.jsxs)(n.a,{href:"/docs/7.x/getting-started",children:[(0,t.jsx)(n.code,{children:"@react-navigation/native"})," and its dependencies (follow this guide)"]}),", then install ",(0,t.jsx)(n.a,{href:"https://github.com/react-navigation/react-navigation/tree/main/packages/drawer",children:(0,t.jsx)(n.code,{children:"@react-navigation/drawer"})}),":"]}),"\n",(0,t.jsxs)(i.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(o.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install @react-navigation/drawer@next\n"})})}),(0,t.jsx)(o.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn add @react-navigation/drawer@next\n"})})}),(0,t.jsx)(o.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm add @react-navigation/drawer@next\n"})})})]}),"\n",(0,t.jsx)(n.p,{children:"Then, you need to install and configure the libraries that are required by the drawer navigator:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["First, install ",(0,t.jsx)(n.a,{href:"https://docs.swmansion.com/react-native-gesture-handler/",children:(0,t.jsx)(n.code,{children:"react-native-gesture-handler"})})," and ",(0,t.jsx)(n.a,{href:"https://docs.swmansion.com/react-native-reanimated/",children:(0,t.jsx)(n.code,{children:"react-native-reanimated"})})," (at least version 2 or 3)."]}),"\n",(0,t.jsx)(n.p,{children:"If you have a Expo managed project, in your project directory, run:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npx expo install react-native-gesture-handler react-native-reanimated\n"})}),"\n",(0,t.jsx)(n.p,{children:"If you have a bare React Native project, in your project directory, run:"}),"\n",(0,t.jsxs)(i.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(o.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install react-native-gesture-handler react-native-reanimated\n"})})}),(0,t.jsx)(o.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn add react-native-gesture-handler react-native-reanimated\n"})})}),(0,t.jsx)(o.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm add react-native-gesture-handler react-native-reanimated\n"})})})]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Configure the Reanimated Babel Plugin in your project following the ",(0,t.jsx)(n.a,{href:"https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started",children:"installation guide"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["To finalize the installation of ",(0,t.jsx)(n.code,{children:"react-native-gesture-handler"}),", we need to conditionally import it. To do this, create 2 files:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="gesture-handler.native.js"',children:"// Only import react-native-gesture-handler on native platforms\nimport 'react-native-gesture-handler';\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="gesture-handler.js"',children:"// Don't import react-native-gesture-handler on web\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Now, add the following at the ",(0,t.jsx)(n.strong,{children:"top"})," (make sure it's at the top and there's nothing else before it) of your entry file, such as ",(0,t.jsx)(n.code,{children:"index.js"})," or ",(0,t.jsx)(n.code,{children:"App.js"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import './gesture-handler';\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Since the drawer navigator doesn't use ",(0,t.jsx)(n.code,{children:"react-native-gesture-handler"})," on Web, this avoids unnecessarily increasing the bundle size."]}),"\n",(0,t.jsx)(n.admonition,{type:"warning",children:(0,t.jsx)(n.p,{children:"If you are building for Android or iOS, do not skip this step, or your app may crash in production even if it works fine in development. This is not applicable to other platforms."})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["If you're on a Mac and developing for iOS, you also need to install the pods (via ",(0,t.jsx)(n.a,{href:"https://cocoapods.org/",children:"Cocoapods"}),") to complete the linking."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npx pod-install ios\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsxs)(n.p,{children:["To use this navigator, import it from ",(0,t.jsx)(n.code,{children:"@react-navigation/drawer"}),":"]}),"\n",(0,t.jsxs)(i.Z,{groupId:"config",queryString:"config",children:[(0,t.jsx)(o.Z,{value:"static",label:"Static",default:!0,children:(0,t.jsx)(n.pre,{"data-name":"Drawer Navigator","data-snack":"true",children:(0,t.jsx)(n.code,{className:"language-js",metastring:'name="Drawer Navigator" snack',children:"import * as React from 'react';\nimport { Text, View } from 'react-native';\nimport {\n createStaticNavigation,\n useNavigation,\n} from '@react-navigation/native';\nimport { Button } from '@react-navigation/elements';\n// codeblock-focus-start\nimport { createDrawerNavigator } from '@react-navigation/drawer';\n\n// codeblock-focus-end\nfunction HomeScreen() {\n const navigation = useNavigation();\n\n return (\n backBehavior
",id:"backbehavior",level:4},{value:"defaultStatus
",id:"defaultstatus",level:4},{value:"detachInactiveScreens
",id:"detachinactivescreens",level:4},{value:"drawerContent
",id:"drawercontent",level:4},{value:"Providing a custom drawerContent
",id:"providing-a-custom-drawercontent",level:5},{value:"Options",id:"options",level:3},{value:"title
",id:"title",level:4},{value:"lazy
",id:"lazy",level:4},{value:"drawerLabel
",id:"drawerlabel",level:4},{value:"drawerIcon
",id:"drawericon",level:4},{value:"drawerActiveTintColor
",id:"draweractivetintcolor",level:4},{value:"drawerActiveBackgroundColor
",id:"draweractivebackgroundcolor",level:4},{value:"drawerInactiveTintColor
",id:"drawerinactivetintcolor",level:4},{value:"drawerInactiveBackgroundColor
",id:"drawerinactivebackgroundcolor",level:4},{value:"drawerItemStyle
",id:"draweritemstyle",level:4},{value:"drawerLabelStyle
",id:"drawerlabelstyle",level:4},{value:"drawerContentContainerStyle
",id:"drawercontentcontainerstyle",level:4},{value:"drawerContentStyle
",id:"drawercontentstyle",level:4},{value:"drawerStyle
",id:"drawerstyle",level:4},{value:"drawerPosition
",id:"drawerposition",level:4},{value:"drawerType
",id:"drawertype",level:4},{value:"drawerHideStatusBarOnOpen
",id:"drawerhidestatusbaronopen",level:4},{value:"drawerStatusBarAnimation
",id:"drawerstatusbaranimation",level:4},{value:"overlayColor
",id:"overlaycolor",level:4},{value:"sceneContainerStyle
",id:"scenecontainerstyle",level:4},{value:"gestureHandlerProps
",id:"gesturehandlerprops",level:4},{value:"swipeEnabled
",id:"swipeenabled",level:4},{value:"swipeEdgeWidth
",id:"swipeedgewidth",level:4},{value:"swipeMinDistance
",id:"swipemindistance",level:4},{value:"keyboardDismissMode
",id:"keyboarddismissmode",level:4},{value:"freezeOnBlur
",id:"freezeonblur",level:4},{value:"popToTopOnBlur
",id:"poptotoponblur",level:4},{value:"Header related options",id:"header-related-options",level:3},{value:"header
",id:"header",level:4},{value:"Specify a height
in headerStyle
",id:"specify-a-height-in-headerstyle",level:5},{value:"headerShown
",id:"headershown",level:4},{value:"Events",id:"events",level:3},{value:"drawerItemPress
",id:"draweritempress",level:4},{value:"Helpers",id:"helpers",level:3},{value:"openDrawer
",id:"opendrawer",level:4},{value:"closeDrawer
",id:"closedrawer",level:4},{value:"toggleDrawer
",id:"toggledrawer",level:4},{value:"jumpTo
",id:"jumpto",level:4},{value:"Hooks",id:"hooks",level:3},{value:"useDrawerProgress
",id:"usedrawerprogress",level:4},{value:"useDrawerStatus
",id:"usedrawerstatus",level:4},{value:"Nesting drawer navigators inside others",id:"nesting-drawer-navigators-inside-others",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",h5:"h5",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.p,{children:"Drawer Navigator renders a navigation drawer on the side of the screen which can be opened and closed via gestures."}),"\n",(0,t.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,loop:!0,children:(0,t.jsx)("source",{src:"/assets/7.x/drawer.mp4"})}),"\n",(0,t.jsxs)(n.p,{children:["This wraps ",(0,t.jsx)(n.a,{href:"/docs/7.x/drawer-layout",children:(0,t.jsx)(n.code,{children:"react-native-drawer-layout"})}),". If you want to use the drawer without React Navigation integration, use the library directly instead."]}),"\n",(0,t.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,t.jsxs)(n.p,{children:["To use this navigator, ensure that you have ",(0,t.jsxs)(n.a,{href:"/docs/7.x/getting-started",children:[(0,t.jsx)(n.code,{children:"@react-navigation/native"})," and its dependencies (follow this guide)"]}),", then install ",(0,t.jsx)(n.a,{href:"https://github.com/react-navigation/react-navigation/tree/main/packages/drawer",children:(0,t.jsx)(n.code,{children:"@react-navigation/drawer"})}),":"]}),"\n",(0,t.jsxs)(i.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(o.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install @react-navigation/drawer@next\n"})})}),(0,t.jsx)(o.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn add @react-navigation/drawer@next\n"})})}),(0,t.jsx)(o.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm add @react-navigation/drawer@next\n"})})})]}),"\n",(0,t.jsx)(n.p,{children:"Then, you need to install and configure the libraries that are required by the drawer navigator:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["First, install ",(0,t.jsx)(n.a,{href:"https://docs.swmansion.com/react-native-gesture-handler/",children:(0,t.jsx)(n.code,{children:"react-native-gesture-handler"})})," and ",(0,t.jsx)(n.a,{href:"https://docs.swmansion.com/react-native-reanimated/",children:(0,t.jsx)(n.code,{children:"react-native-reanimated"})})," (at least version 2 or 3)."]}),"\n",(0,t.jsx)(n.p,{children:"If you have a Expo managed project, in your project directory, run:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npx expo install react-native-gesture-handler react-native-reanimated\n"})}),"\n",(0,t.jsx)(n.p,{children:"If you have a bare React Native project, in your project directory, run:"}),"\n",(0,t.jsxs)(i.Z,{groupId:"npm2yarn",children:[(0,t.jsx)(o.Z,{value:"npm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npm install react-native-gesture-handler react-native-reanimated\n"})})}),(0,t.jsx)(o.Z,{value:"yarn",label:"Yarn",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"yarn add react-native-gesture-handler react-native-reanimated\n"})})}),(0,t.jsx)(o.Z,{value:"pnpm",label:"pnpm",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"pnpm add react-native-gesture-handler react-native-reanimated\n"})})})]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Configure the Reanimated Babel Plugin in your project following the ",(0,t.jsx)(n.a,{href:"https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started",children:"installation guide"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["To finalize the installation of ",(0,t.jsx)(n.code,{children:"react-native-gesture-handler"}),", we need to conditionally import it. To do this, create 2 files:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="gesture-handler.native.js"',children:"// Only import react-native-gesture-handler on native platforms\nimport 'react-native-gesture-handler';\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",metastring:'title="gesture-handler.js"',children:"// Don't import react-native-gesture-handler on web\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Now, add the following at the ",(0,t.jsx)(n.strong,{children:"top"})," (make sure it's at the top and there's nothing else before it) of your entry file, such as ",(0,t.jsx)(n.code,{children:"index.js"})," or ",(0,t.jsx)(n.code,{children:"App.js"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"import './gesture-handler';\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Since the drawer navigator doesn't use ",(0,t.jsx)(n.code,{children:"react-native-gesture-handler"})," on Web, this avoids unnecessarily increasing the bundle size."]}),"\n",(0,t.jsx)(n.admonition,{type:"warning",children:(0,t.jsx)(n.p,{children:"If you are building for Android or iOS, do not skip this step, or your app may crash in production even if it works fine in development. This is not applicable to other platforms."})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["If you're on a Mac and developing for iOS, you also need to install the pods (via ",(0,t.jsx)(n.a,{href:"https://cocoapods.org/",children:"Cocoapods"}),") to complete the linking."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"npx pod-install ios\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsxs)(n.p,{children:["To use this navigator, import it from ",(0,t.jsx)(n.code,{children:"@react-navigation/drawer"}),":"]}),"\n",(0,t.jsxs)(i.Z,{groupId:"config",queryString:"config",children:[(0,t.jsx)(o.Z,{value:"static",label:"Static",default:!0,children:(0,t.jsx)(n.pre,{"data-name":"Drawer Navigator","data-snack":"true",children:(0,t.jsx)(n.code,{className:"language-js",metastring:'name="Drawer Navigator" snack',children:"import * as React from 'react';\nimport { Text, View } from 'react-native';\nimport {\n createStaticNavigation,\n useNavigation,\n} from '@react-navigation/native';\nimport { Button } from '@react-navigation/elements';\n// codeblock-focus-start\nimport { createDrawerNavigator } from '@react-navigation/drawer';\n\n// codeblock-focus-end\nfunction HomeScreen() {\n const navigation = useNavigation();\n\n return (\n backBehavior
",id:"backbehavior",level:4},{value:"detachInactiveScreens
",id:"detachinactivescreens",level:4},{value:"sceneContainerStyle
",id:"scenecontainerstyle",level:4},{value:"tabBar
",id:"tabbar",level:4},{value:"Options",id:"options",level:3},{value:"title
",id:"title",level:4},{value:"tabBarLabel
",id:"tabbarlabel",level:4},{value:"tabBarShowLabel
",id:"tabbarshowlabel",level:4},{value:"tabBarLabelPosition
",id:"tabbarlabelposition",level:4},{value:"tabBarLabelStyle
",id:"tabbarlabelstyle",level:4},{value:"tabBarIcon
",id:"tabbaricon",level:4},{value:"tabBarIconStyle
",id:"tabbariconstyle",level:4},{value:"tabBarBadge
",id:"tabbarbadge",level:4},{value:"tabBarBadgeStyle
",id:"tabbarbadgestyle",level:4},{value:"tabBarAccessibilityLabel
",id:"tabbaraccessibilitylabel",level:4},{value:"tabBarButton
",id:"tabbarbutton",level:4},{value:"tabBarButtonTestID
",id:"tabbarbuttontestid",level:4},{value:"tabBarActiveTintColor
",id:"tabbaractivetintcolor",level:4},{value:"tabBarInactiveTintColor
",id:"tabbarinactivetintcolor",level:4},{value:"tabBarActiveBackgroundColor
",id:"tabbaractivebackgroundcolor",level:4},{value:"tabBarInactiveBackgroundColor
",id:"tabbarinactivebackgroundcolor",level:4},{value:"tabBarHideOnKeyboard
",id:"tabbarhideonkeyboard",level:4},{value:"tabBarItemStyle
",id:"tabbaritemstyle",level:4},{value:"tabBarStyle
",id:"tabbarstyle",level:4},{value:"tabBarBackground
",id:"tabbarbackground",level:4},{value:"tabBarPosition
",id:"tabbarposition",level:4},{value:"tabBarVariant
",id:"tabbarvariant",level:4},{value:"lazy
",id:"lazy",level:4},{value:"freezeOnBlur
",id:"freezeonblur",level:4},{value:"popToTopOnBlur
",id:"poptotoponblur",level:4},{value:"Header related options",id:"header-related-options",level:3},{value:"header
",id:"header",level:4},{value:"Specify a height
in headerStyle
",id:"specify-a-height-in-headerstyle",level:5},{value:"headerShown
",id:"headershown",level:4},{value:"Events",id:"events",level:3},{value:"tabPress
",id:"tabpress",level:4},{value:"tabLongPress
",id:"tablongpress",level:4},{value:"Helpers",id:"helpers",level:3},{value:"jumpTo
",id:"jumpto",level:4},{value:"Hooks",id:"hooks",level:3},{value:"useBottomTabBarHeight
",id:"usebottomtabbarheight",level:4},{value:"Animations",id:"animations",level:2},{value:"Animation related options",id:"animation-related-options",level:3},{value:"Pre-made configs",id:"pre-made-configs",level:3},{value:"TransitionSpecs
",id:"transitionspecs",level:4},{value:"SceneStyleInterpolators
",id:"scenestyleinterpolators",level:4},{value:"TransitionPresets
",id:"transitionpresets",level:4}];function u(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",h5:"h5",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.p,{children:"A simple tab bar on the bottom of the screen that lets you switch between different routes. Routes are lazily initialized -- their screen components are not mounted until they are first focused."}),"\n",(0,a.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,loop:!0,children:(0,a.jsx)("source",{src:"/assets/7.x/bottom-tabs.mp4"})}),"\n",(0,a.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,a.jsxs)(n.p,{children:["To use this navigator, ensure that you have ",(0,a.jsxs)(n.a,{href:"/docs/7.x/getting-started",children:[(0,a.jsx)(n.code,{children:"@react-navigation/native"})," and its dependencies (follow this guide)"]}),", then install ",(0,a.jsx)(n.a,{href:"https://github.com/react-navigation/react-navigation/tree/main/packages/bottom-tabs",children:(0,a.jsx)(n.code,{children:"@react-navigation/bottom-tabs"})}),":"]}),"\n",(0,a.jsxs)(o.Z,{groupId:"npm2yarn",children:[(0,a.jsx)(r.Z,{value:"npm",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"npm install @react-navigation/bottom-tabs@next\n"})})}),(0,a.jsx)(r.Z,{value:"yarn",label:"Yarn",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"yarn add @react-navigation/bottom-tabs@next\n"})})}),(0,a.jsx)(r.Z,{value:"pnpm",label:"pnpm",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"pnpm add @react-navigation/bottom-tabs@next\n"})})})]}),"\n",(0,a.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,a.jsxs)(n.p,{children:["To use this navigator, import it from ",(0,a.jsx)(n.code,{children:"@react-navigation/bottom-tabs"}),":"]}),"\n",(0,a.jsxs)(o.Z,{groupId:"config",queryString:"config",children:[(0,a.jsx)(r.Z,{value:"static",label:"Static",default:!0,children:(0,a.jsx)(n.pre,{"data-name":"Bottom Tab Navigator","data-snack":"true",children:(0,a.jsx)(n.code,{className:"language-js",metastring:'name="Bottom Tab Navigator" snack',children:"import * as React from 'react';\nimport { Text, View } from 'react-native';\nimport {\n createStaticNavigation,\n useNavigation,\n} from '@react-navigation/native';\nimport { Button } from '@react-navigation/elements';\n// codeblock-focus-start\nimport { createBottomTabNavigator } from '@react-navigation/bottom-tabs';\n\n// codeblock-focus-end\nfunction HomeScreen() {\n const navigation = useNavigation();\n\n return (\n backBehavior
",id:"backbehavior",level:4},{value:"detachInactiveScreens
",id:"detachinactivescreens",level:4},{value:"sceneContainerStyle
",id:"scenecontainerstyle",level:4},{value:"tabBar
",id:"tabbar",level:4},{value:"Options",id:"options",level:3},{value:"title
",id:"title",level:4},{value:"tabBarLabel
",id:"tabbarlabel",level:4},{value:"tabBarShowLabel
",id:"tabbarshowlabel",level:4},{value:"tabBarLabelPosition
",id:"tabbarlabelposition",level:4},{value:"tabBarLabelStyle
",id:"tabbarlabelstyle",level:4},{value:"tabBarIcon
",id:"tabbaricon",level:4},{value:"tabBarIconStyle
",id:"tabbariconstyle",level:4},{value:"tabBarBadge
",id:"tabbarbadge",level:4},{value:"tabBarBadgeStyle
",id:"tabbarbadgestyle",level:4},{value:"tabBarAccessibilityLabel
",id:"tabbaraccessibilitylabel",level:4},{value:"tabBarButton
",id:"tabbarbutton",level:4},{value:"tabBarButtonTestID
",id:"tabbarbuttontestid",level:4},{value:"tabBarActiveTintColor
",id:"tabbaractivetintcolor",level:4},{value:"tabBarInactiveTintColor
",id:"tabbarinactivetintcolor",level:4},{value:"tabBarActiveBackgroundColor
",id:"tabbaractivebackgroundcolor",level:4},{value:"tabBarInactiveBackgroundColor
",id:"tabbarinactivebackgroundcolor",level:4},{value:"tabBarHideOnKeyboard
",id:"tabbarhideonkeyboard",level:4},{value:"tabBarItemStyle
",id:"tabbaritemstyle",level:4},{value:"tabBarStyle
",id:"tabbarstyle",level:4},{value:"tabBarBackground
",id:"tabbarbackground",level:4},{value:"tabBarPosition
",id:"tabbarposition",level:4},{value:"tabBarVariant
",id:"tabbarvariant",level:4},{value:"lazy
",id:"lazy",level:4},{value:"freezeOnBlur
",id:"freezeonblur",level:4},{value:"popToTopOnBlur
",id:"poptotoponblur",level:4},{value:"Header related options",id:"header-related-options",level:3},{value:"header
",id:"header",level:4},{value:"Specify a height
in headerStyle
",id:"specify-a-height-in-headerstyle",level:5},{value:"headerShown
",id:"headershown",level:4},{value:"Events",id:"events",level:3},{value:"tabPress
",id:"tabpress",level:4},{value:"tabLongPress
",id:"tablongpress",level:4},{value:"Helpers",id:"helpers",level:3},{value:"jumpTo
",id:"jumpto",level:4},{value:"Hooks",id:"hooks",level:3},{value:"useBottomTabBarHeight
",id:"usebottomtabbarheight",level:4},{value:"Animations",id:"animations",level:2},{value:"Animation related options",id:"animation-related-options",level:3},{value:"Pre-made configs",id:"pre-made-configs",level:3},{value:"TransitionSpecs
",id:"transitionspecs",level:4},{value:"SceneStyleInterpolators
",id:"scenestyleinterpolators",level:4},{value:"TransitionPresets
",id:"transitionpresets",level:4}];function u(e){const n={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",h5:"h5",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.p,{children:"A simple tab bar on the bottom of the screen that lets you switch between different routes. Routes are lazily initialized -- their screen components are not mounted until they are first focused."}),"\n",(0,a.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,loop:!0,children:(0,a.jsx)("source",{src:"/assets/7.x/bottom-tabs.mp4"})}),"\n",(0,a.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,a.jsxs)(n.p,{children:["To use this navigator, ensure that you have ",(0,a.jsxs)(n.a,{href:"/docs/7.x/getting-started",children:[(0,a.jsx)(n.code,{children:"@react-navigation/native"})," and its dependencies (follow this guide)"]}),", then install ",(0,a.jsx)(n.a,{href:"https://github.com/react-navigation/react-navigation/tree/main/packages/bottom-tabs",children:(0,a.jsx)(n.code,{children:"@react-navigation/bottom-tabs"})}),":"]}),"\n",(0,a.jsxs)(o.Z,{groupId:"npm2yarn",children:[(0,a.jsx)(r.Z,{value:"npm",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"npm install @react-navigation/bottom-tabs@next\n"})})}),(0,a.jsx)(r.Z,{value:"yarn",label:"Yarn",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"yarn add @react-navigation/bottom-tabs@next\n"})})}),(0,a.jsx)(r.Z,{value:"pnpm",label:"pnpm",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"pnpm add @react-navigation/bottom-tabs@next\n"})})})]}),"\n",(0,a.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,a.jsxs)(n.p,{children:["To use this navigator, import it from ",(0,a.jsx)(n.code,{children:"@react-navigation/bottom-tabs"}),":"]}),"\n",(0,a.jsxs)(o.Z,{groupId:"config",queryString:"config",children:[(0,a.jsx)(r.Z,{value:"static",label:"Static",default:!0,children:(0,a.jsx)(n.pre,{"data-name":"Bottom Tab Navigator","data-snack":"true",children:(0,a.jsx)(n.code,{className:"language-js",metastring:'name="Bottom Tab Navigator" snack',children:"import * as React from 'react';\nimport { Text, View } from 'react-native';\nimport {\n createStaticNavigation,\n useNavigation,\n} from '@react-navigation/native';\nimport { Button } from '@react-navigation/elements';\n// codeblock-focus-start\nimport { createBottomTabNavigator } from '@react-navigation/bottom-tabs';\n\n// codeblock-focus-end\nfunction HomeScreen() {\n const navigation = useNavigation();\n\n return (\n Your Docusaurus site did not load properly.
\nA very common reason is a wrong site baseUrl configuration.
\nCurrent configured baseUrl = '+e+" "+("/"===e?" (default value)":"")+'
\nWe suggest trying baseUrl =
\n.comment
can become .namespace--comment
) or replace them with your defined ones (like .editor__comment
). You can even add new classes.",owner:"dvkndn",noCSS:!0},"file-highlight":{title:"File Highlight",description:"Fetch external files and highlight them with Prism. Used on the Prism website itself.",noCSS:!0},"show-language":{title:"Show Language",description:"Display the highlighted language in code blocks (inline code does not show the label).",owner:"nauzilus",noCSS:!0,require:"toolbar"},"jsonp-highlight":{title:"JSONP Highlight",description:"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",noCSS:!0,owner:"nauzilus"},"highlight-keywords":{title:"Highlight Keywords",description:"Adds special CSS classes for each keyword for fine-grained highlighting.",owner:"vkbansal",noCSS:!0},"remove-initial-line-feed":{title:"Remove initial line feed",description:"Removes the initial line feed in code blocks.",owner:"Golmote",noCSS:!0},"inline-color":{title:"Inline color",description:"Adds a small inline preview for colors in style sheets.",require:"css-extras",owner:"RunDevelopment"},previewers:{title:"Previewers",description:"Previewers for angles, colors, gradients, easing and time.",require:"css-extras",owner:"Golmote"},autoloader:{title:"Autoloader",description:"Automatically loads the needed languages to highlight the code blocks.",owner:"Golmote",noCSS:!0},"keep-markup":{title:"Keep Markup",description:"Prevents custom markup from being dropped out during highlighting.",owner:"Golmote",optional:"normalize-whitespace",noCSS:!0},"command-line":{title:"Command Line",description:"Display a command line with a prompt and, optionally, the output/response from the commands.",owner:"chriswells0"},"unescaped-markup":{title:"Unescaped Markup",description:"Write markup without having to escape anything."},"normalize-whitespace":{title:"Normalize Whitespace",description:"Supports multiple operations to normalize whitespace in code blocks.",owner:"zeitgeist87",optional:"unescaped-markup",noCSS:!0},"data-uri-highlight":{title:"Data-URI Highlight",description:"Highlights data-URI contents.",owner:"Golmote",noCSS:!0},toolbar:{title:"Toolbar",description:"Attach a toolbar for plugins to easily register buttons on the top of a code block.",owner:"mAAdhaTTah"},"copy-to-clipboard":{title:"Copy to Clipboard Button",description:"Add a button that copies the code block to the clipboard when clicked.",owner:"mAAdhaTTah",require:"toolbar",noCSS:!0},"download-button":{title:"Download Button",description:"A button in the toolbar of a code block adding a convenient way to download a code file.",owner:"Golmote",require:"toolbar",noCSS:!0},"match-braces":{title:"Match braces",description:"Highlights matching braces.",owner:"RunDevelopment"},"diff-highlight":{title:"Diff Highlight",description:"Highlights the code inside diff blocks.",owner:"RunDevelopment",require:"diff"},"filter-highlight-all":{title:"Filter highlightAll",description:"Filters the elements the highlightAll
and highlightAllUnder
methods actually highlight.",owner:"RunDevelopment",noCSS:!0},treeview:{title:"Treeview",description:"A language with special styles to highlight file system tree structures.",owner:"Golmote"}}})},2885:(e,t,n)=>{const o=n(29901),a=n(39642),r=new Set;function i(e){void 0===e?e=Object.keys(o.languages).filter((e=>"meta"!=e)):Array.isArray(e)||(e=[e]);const t=[...r,...Object.keys(Prism.languages)];a(o,e,t).load((e=>{if(!(e in o.languages))return void(i.silent||console.warn("Language does not exist: "+e));const t="./prism-"+e;delete n.c[n(16500).resolve(t)],delete Prism.languages[e],n(16500)(t),r.add(e)}))}i.silent=!1,e.exports=i},96854:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,o,a,r){if(n.language===o){var i=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof r&&!r(e))return e;for(var a,s=i.length;-1!==n.code.indexOf(a=t(o,s));)++s;return i[s]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,o){if(n.language===o&&n.tokenStack){n.grammar=e.languages[o];var a=0,r=Object.keys(n.tokenStack);!function i(s){for(var c=0;c