this repo has no description
at main 171 kB view raw
1<!doctype html><html lang=en dir=ltr class="docs-wrapper plugin-docs plugin-id-default docs-version-0.79 docs-doc-page docs-doc-id-flexbox" data-has-hydrated=false><meta charset=UTF-8><meta name=generator content="Docusaurus v3.8.0"><title data-rh=true>Layout with Flexbox · React Native</title><meta data-rh=true name=viewport content="width=device-width, initial-scale=1.0"><meta data-rh=true property=og:url content=https://reactnative.dev/docs/flexbox><meta data-rh=true property=og:locale content=en><meta data-rh=true name=docusaurus_locale content=en><meta data-rh=true name=docsearch:language content=en><meta data-rh=true property=og:image content=https://reactnative.dev/img/logo-share.png><meta data-rh=true name=twitter:card content=summary_large_image><meta data-rh=true name=twitter:image content=https://reactnative.dev/img/logo-share.png><meta data-rh=true name=twitter:site content=@reactnative><meta data-rh=true name=docusaurus_version content=0.79><meta data-rh=true name=docusaurus_tag content=docs-default-0.79><meta data-rh=true name=docsearch:version content=0.79><meta data-rh=true name=docsearch:docusaurus_tag content=docs-default-0.79><meta data-rh=true property=og:title content="Layout with Flexbox · React Native"><meta data-rh=true name=description content="A component can specify the layout of its children using the Flexbox algorithm. Flexbox is designed to provide a consistent layout on different screen sizes."><meta data-rh=true property=og:description content="A component can specify the layout of its children using the Flexbox algorithm. Flexbox is designed to provide a consistent layout on different screen sizes."><link data-rh=true rel=icon href=/img/favicon.ico><link data-rh=true rel=canonical href=https://reactnative.dev/docs/flexbox><link data-rh=true rel=alternate href=https://reactnative.dev/docs/flexbox hreflang=en><link data-rh=true rel=alternate href=https://reactnative.dev/docs/flexbox hreflang=x-default><link data-rh=true rel=preconnect href=https://8TDSE0OHGQ-dsn.algolia.net crossorigin=anonymous><link rel=alternate type=application/rss+xml href=/blog/rss.xml title="React Native RSS Feed"><link rel=alternate type=application/atom+xml href=/blog/atom.xml title="React Native Atom Feed"><link rel=alternate type=application/json href=/blog/feed.json title="React Native JSON Feed"><link rel=preconnect href=https://www.google-analytics.com><script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","UA-41298772-2","auto"),ga("send","pageview")</script><script async src=https://www.google-analytics.com/analytics.js></script><link rel=preconnect href=https://www.google-analytics.com><link rel=preconnect href=https://www.googletagmanager.com><script async src="https://www.googletagmanager.com/gtag/js?id=G-58L13S6BDP"></script><script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-58L13S6BDP",{})</script><link rel=search type=application/opensearchdescription+xml title="React Native" href=/opensearch.xml><link rel=icon href=/img/pwa/manifest-icon-512.png><link rel=manifest href=/manifest.json><meta name=theme-color content=#20232a><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=#20232a><link rel=apple-touch-icon href=/img/pwa/manifest-icon-512.png><link rel=mask-icon href=/img/pwa/manifest-icon-512.png color=#06bcee><meta name=msapplication-TileImage href=/img/pwa/manifest-icon-512.png><meta name=msapplication-TileColor content=#20232a><script src=https://cdn.jsdelivr.net/npm/focus-visible@5.2.0/dist/focus-visible.min.js defer></script><script src=https://widget.surveymonkey.com/collect/website/js/tRaiETqnLgj758hTBazgd8ryO5qrZo8Exadq9qmt1wtm4_2FdZGEAKHDFEt_2BBlwwM4.js defer></script><script src=https://snack.expo.dev/embed.js defer></script><script src=https://platform.twitter.com/widgets.js async></script><link rel=stylesheet href=/assets/css/styles.883cb042.css><script src=/assets/js/runtime~main.8ac1e6f0.js defer></script><script src=/assets/js/main.341783f5.js defer></script><body class=navigation-with-keyboard><svg xmlns=http://www.w3.org/2000/svg style="display: none;"><defs> 2<symbol id=theme-svg-external-link viewBox="0 0 24 24"><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></symbol> 3</defs></svg> 4<script>!function(){var t=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();document.documentElement.setAttribute("data-theme",t||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")),document.documentElement.setAttribute("data-theme-choice",t||"system")}(),function(){try{for(var[t,e]of new URLSearchParams(window.location.search).entries())if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}(),document.documentElement.setAttribute("data-announcement-bar-initially-dismissed",function(){try{return"true"===localStorage.getItem("docusaurus.announcement.dismiss")}catch(t){}return!1}())</script><div id=__docusaurus><div role=region aria-label="Skip to main content"><a class=skipToContent_oPtH href=#__docusaurus_skipToContent_fallback>Skip to main content</a></div><div class="theme-announcement-bar announcementBar_zJRd" style=background-color:#20232a;color:#fff role=banner><div class="content_bSb_ announcementBarContent_t7IR">Join us for React Conf on Oct 7-8. <a target=_blank rel="noopener noreferrer" href=https://conf.react.dev>Learn more</a>.</div></div><nav aria-label=Main class="theme-layout-navbar navbar navbar--fixed-top navbar--dark"><div class=navbar__inner><div class="theme-layout-navbar-left navbar__items"><button aria-label="Toggle navigation bar" aria-expanded=false class="navbar__toggle clean-btn" type=button><svg width=30 height=30 viewBox="0 0 30 30" aria-hidden=true><path stroke=currentColor stroke-linecap=round stroke-miterlimit=10 stroke-width=2 d="M4 7h22M4 15h22M4 23h22"/></svg></button><a class=navbar__brand href=/><div class=navbar__logo><img src=/img/header_logo.svg alt="React Native" class="themedComponent_siVc themedComponent--light_hHel"><img src=/img/header_logo.svg alt="React Native" class="themedComponent_siVc themedComponent--dark_yETr"></div><b class="navbar__title text--truncate">React Native</b></a><div class="navbar__item dropdown dropdown--hoverable"><a class=navbar__link aria-haspopup=true aria-expanded=false role=button href=/docs/flexbox>0.79</a><ul class=dropdown__menu><li><a class=dropdown__link href=/docs/next/flexbox>Next</a><li><a aria-current=page class="dropdown__link dropdown__link--active" href=/docs/flexbox>0.79</a><li><a class=dropdown__link href=/docs/0.78/flexbox>0.78</a><li><a class=dropdown__link href=/docs/0.77/flexbox>0.77</a><li><a class=dropdown__link href=/docs/0.76/flexbox>0.76</a><li><a class=dropdown__link href=/docs/0.75/flexbox>0.75</a><li><a class=dropdown__link href=/docs/0.74/flexbox>0.74</a><li><a class=dropdown__link href=/docs/0.73/flexbox>0.73</a><li><a class=dropdown__link href=/docs/0.72/flexbox>0.72</a><li><a class=dropdown__link href=/docs/0.71/flexbox>0.71</a><li><a class=dropdown__link href=/docs/0.70/flexbox>0.70</a><li><a class=dropdown__link href=/versions>All versions</a></ul></div></div><div class="theme-layout-navbar-right navbar__items navbar__items--right"><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a href=# aria-haspopup=true aria-expanded=false role=button class=navbar__link>Development</a><ul class=dropdown__menu><li><a aria-current=page class="dropdown__link dropdown__link--active" href=/docs/getting-started>Guides</a><li><a class=dropdown__link href=/docs/components-and-apis>Components</a><li><a class=dropdown__link href=/docs/accessibilityinfo>APIs</a><li><a class=dropdown__link href=/architecture/overview>Architecture</a></ul></div><a class="navbar__item navbar__link" href=/contributing/overview>Contributing</a><a class="navbar__item navbar__link" href=/community/overview>Community</a><a class="navbar__item navbar__link" href=/showcase>Showcase</a><a class="navbar__item navbar__link" href=/blog>Blog</a><a href=https://github.com/facebook/react-native target=_blank rel="noopener noreferrer" class="navbar__item navbar__link navbar-github-link" aria-label="GitHub repository"></a><div class="toggle_ki11 colorModeToggle_Hewu"><button class="clean-btn toggleButton_MMFG toggleButtonDisabled_Uw7m darkNavbarColorModeToggle_m8pZ" type=button disabled title="system mode" aria-label="Switch between dark and light mode (currently system mode)"><svg viewBox="0 0 24 24" width=24 height=24 aria-hidden=true class="toggleIcon_k9hJ lightToggleIcon_lgto"><path fill=currentColor d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"/></svg><svg viewBox="0 0 24 24" width=24 height=24 aria-hidden=true class="toggleIcon_k9hJ darkToggleIcon_U96C"><path fill=currentColor d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"/></svg><svg viewBox="0 0 24 24" width=24 height=24 aria-hidden=true class="toggleIcon_k9hJ systemToggleIcon_E5c0"><path fill=currentColor d="m12 21c4.971 0 9-4.029 9-9s-4.029-9-9-9-9 4.029-9 9 4.029 9 9 9zm4.95-13.95c1.313 1.313 2.05 3.093 2.05 4.95s-0.738 3.637-2.05 4.95c-1.313 1.313-3.093 2.05-4.95 2.05v-14c1.857 0 3.637 0.737 4.95 2.05z"/></svg></button></div><div class=navbarSearchContainer_bzqh><button type=button class="DocSearch DocSearch-Button" aria-label="Search (Command+K)"><span class=DocSearch-Button-Container><svg width=20 height=20 class=DocSearch-Search-Icon viewBox="0 0 20 20" aria-hidden=true><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke=currentColor fill=none fill-rule=evenodd stroke-linecap=round stroke-linejoin=round /></svg><span class=DocSearch-Button-Placeholder>Search</span></span><span class=DocSearch-Button-Keys></span></button></div></div></div><div role=presentation class=navbar-sidebar__backdrop></div></nav><div id=__docusaurus_skipToContent_fallback class="theme-layout-main main-wrapper mainWrapper_MB5r"><div class=docsWrapper__sE8><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_iEvu" type=button></button><div class=docRoot_DfVB><aside class="theme-doc-sidebar-container docSidebarContainer_c7NB"><div class=sidebarViewport_KYo0><div class=sidebar_CUen><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_jmj1 menuWithAnnouncementBar_YufC"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/getting-started>The Basics</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/environment-setup>Environment setup</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/running-on-device>Workflow</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" role=button aria-expanded=true href=/docs/style>UI & Interaction</a></div><ul class=menu__list><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/docs/style>Style</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/docs/height-and-width>Height and Width</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current=page tabindex=0 href=/docs/flexbox>Layout with Flexbox</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/docs/images>Images</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class=menu__link tabindex=0 href=/docs/colors>Color Reference</a><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class=menu__list-item-collapsible><a class=menu__link tabindex=0>Interaction</a></div><ul class=menu__list><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class=menu__link tabindex=0 href=/docs/handling-touches>Handling Touches</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class=menu__link tabindex=0 href=/docs/navigation>Navigating Between Screens</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class=menu__link tabindex=0 href=/docs/animations>Animations</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class=menu__link tabindex=0 href=/docs/gesture-responder-system>Gesture Responder System</a></ul><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class=menu__list-item-collapsible><a class=menu__link tabindex=0>Connectivity</a></div><ul class=menu__list><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class=menu__link tabindex=0 href=/docs/network>Networking</a><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class=menu__link tabindex=0 href=/docs/security>Security</a></ul><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class=menu__list-item-collapsible><a class=menu__link tabindex=0>Inclusion</a></div><ul class=menu__list><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class=menu__link tabindex=0 href=/docs/accessibility>Accessibility</a></ul></ul><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/debugging>Debugging</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/testing-overview>Testing</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/performance>Performance</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/javascript-environment>JavaScript Runtime</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/the-new-architecture/what-is-codegen>Codegen</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/native-platform>Native Development</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/headless-js-android>Android and iOS guides</a></div><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class=menu__list-item-collapsible><a class="menu__link menu__link--sublist menu__link--sublist-caret" role=button aria-expanded=false href=/docs/legacy/native-modules-intro>Legacy Architecture</a></div></ul></nav></div></div></aside><main class=docMainContainer_a9sJ><div class="container padding-top--md padding-bottom--lg"><div class=row><div class="col docItemCol_Qr34"><div class=docItemContainer_tjFy><article><div class="tocCollapsible_wXna theme-doc-toc-mobile tocMobile_Ojys"><button type=button class="clean-btn tocCollapsibleButton_iI2p">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Layout with Flexbox</h1></header><p>A component can specify the layout of its children using the Flexbox algorithm. Flexbox is designed to provide a consistent layout on different screen sizes.</p> 5<p>You will normally use a combination of <code>flexDirection</code>, <code>alignItems</code>, and <code>justifyContent</code> to achieve the right layout.</p> 6<div class="theme-admonition theme-admonition-caution admonition_WCGJ alert alert--warning"><div class=admonitionHeading_GCBg><span class=admonitionIcon_L39b><svg viewBox="0 0 16 16"><path fill-rule=evenodd d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"/></svg></span>caution</div><div class=admonitionContent_pbrs><p>Flexbox works the same way in React Native as it does in CSS on the web, with a few exceptions. 7The defaults are different, with <code>flexDirection</code> defaulting to <code>column</code> instead of <code>row</code>, <code>alignContent</code> defaulting to <code>flex-start</code> instead of <code>stretch</code>, <code>flexShrink</code> defaulting to <code>0</code> instead of <code>1</code>, the <code>flex</code> parameter only supporting a single number.</div></div> 8<h2 class="anchor anchorWithStickyNavbar_JmGV" id=flex>Flex<a href=#flex class=hash-link aria-label="Direct link to Flex" title="Direct link to Flex"></a></h2> 9<p><a href=/docs/layout-props#flex><code>flex</code></a> will define how your items are going to <strong>“fill”</strong> over the available space along your main axis. Space will be divided according to each element's flex property.</p> 10<p>In the following example, the red, orange, and green views are all children in the container view that has <code>flex: 1</code> set. The red view uses <code>flex: 1</code> , the orange view uses <code>flex: 2</code>, and the green view uses <code>flex: 3</code> . <strong>1+2+3 = 6</strong>, which means that the red view will get <code>1/6</code> of the space, the orange <code>2/6</code> of the space, and the green <code>3/6</code> of the space.</p> 11<div class=snack-player data-snack-name="Flex Example" data-snack-description="Example usage" data-snack-files="%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%20from%20'react'%3B%5Cnimport%20%7BStyleSheet%2C%20View%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20Flex%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20return%20(%5Cn%20%20%20%20%3CView%5Cn%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20styles.container%2C%5Cn%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%2F%2F%20Try%20setting%20%60flexDirection%60%20to%20%60%5C%22row%5C%22%60.%5Cn%20%20%20%20%20%20%20%20%20%20flexDirection%3A%20'column'%2C%5Cn%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%7Bflex%3A%201%2C%20backgroundColor%3A%20'red'%7D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%7Bflex%3A%202%2C%20backgroundColor%3A%20'darkorange'%7D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%7Bflex%3A%203%2C%20backgroundColor%3A%20'green'%7D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20padding%3A%2020%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20Flex%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div> 12<h2 class="anchor anchorWithStickyNavbar_JmGV" id=flex-direction>Flex Direction<a href=#flex-direction class=hash-link aria-label="Direct link to Flex Direction" title="Direct link to Flex Direction"></a></h2> 13<p><a href=/docs/layout-props#flexdirection><code>flexDirection</code></a> controls the direction in which the children of a node are laid out. This is also referred to as the main axis. The cross axis is the axis perpendicular to the main axis, or the axis which the wrapping lines are laid out in.</p> 14<ul> 15<li> 16<p><code>column</code> (<strong>default value</strong>) Align children from top to bottom. If wrapping is enabled, then the next line will start to the right of the first item on the top of the container.</p> 17</li> 18<li> 19<p><code>row</code> Align children from left to right. If wrapping is enabled, then the next line will start under the first item on the left of the container.</p> 20</li> 21<li> 22<p><code>column-reverse</code> Align children from bottom to top. If wrapping is enabled, then the next line will start to the right of the first item on the bottom of the container.</p> 23</li> 24<li> 25<p><code>row-reverse</code> Align children from right to left. If wrapping is enabled, then the next line will start under the first item on the right of the container.</p> 26</li> 27</ul> 28<p>You can learn more <a href=https://www.yogalayout.dev/docs/styling/flex-direction target=_blank rel="noopener noreferrer">here</a>.</p> 29<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">TypeScript<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">JavaScript</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb hidden><div class=snack-player data-snack-name="Flex Direction" data-snack-description="Example usage" data-snack-files="%7B%22App.js%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BStyleSheet%2C%20Text%2C%20TouchableOpacity%2C%20View%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20FlexDirectionBasics%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BflexDirection%2C%20setflexDirection%5D%20%3D%20useState('column')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22flexDirection%5C%22%5Cn%20%20%20%20%20%20values%3D%7B%5B'column'%2C%20'row'%2C%20'column-reverse'%2C%20'row-reverse'%5D%7D%5Cn%20%20%20%20%20%20selectedValue%3D%7BflexDirection%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetflexDirection%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'powderblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'skyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'steelblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7B%5Blabel%5D%3A%20selectedValue%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20FlexDirectionBasics%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div><div role=tabpanel class=tabItem_wHwb><div class=snack-player data-snack-name="Flex Direction" data-snack-description="Example usage" data-snack-files="%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BStyleSheet%2C%20Text%2C%20TouchableOpacity%2C%20View%7D%20from%20'react-native'%3B%5Cnimport%20type%20%7BPropsWithChildren%7D%20from%20'react'%3B%5Cn%5Cnconst%20FlexDirectionBasics%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BflexDirection%2C%20setflexDirection%5D%20%3D%20useState('column')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22flexDirection%5C%22%5Cn%20%20%20%20%20%20values%3D%7B%5B'column'%2C%20'row'%2C%20'column-reverse'%2C%20'row-reverse'%5D%7D%5Cn%20%20%20%20%20%20selectedValue%3D%7BflexDirection%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetflexDirection%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'powderblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'skyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'steelblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cntype%20PreviewLayoutProps%20%3D%20PropsWithChildren%3C%7B%5Cn%20%20label%3A%20string%3B%5Cn%20%20values%3A%20string%5B%5D%3B%5Cn%20%20selectedValue%3A%20string%3B%5Cn%20%20setSelectedValue%3A%20(value%3A%20string)%20%3D%3E%20void%3B%5Cn%7D%3E%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D%3A%20PreviewLayoutProps)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7B%5Blabel%5D%3A%20selectedValue%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20FlexDirectionBasics%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div></div></div> 30<h2 class="anchor anchorWithStickyNavbar_JmGV" id=layout-direction>Layout Direction<a href=#layout-direction class=hash-link aria-label="Direct link to Layout Direction" title="Direct link to Layout Direction"></a></h2> 31<p>Layout <a href=/docs/layout-props#direction><code>direction</code></a> specifies the direction in which children and text in a hierarchy should be laid out. Layout direction also affects what edge <code>start</code> and <code>end</code> refer to. By default, React Native lays out with LTR layout direction. In this mode <code>start</code> refers to left and <code>end</code> refers to right.</p> 32<ul> 33<li> 34<p><code>LTR</code> (<strong>default value</strong>) Text and children are laid out from left to right. Margin and padding applied to the start of an element are applied on the left side.</p> 35</li> 36<li> 37<p><code>RTL</code> Text and children are laid out from right to left. Margin and padding applied to the start of an element are applied on the right side.</p> 38</li> 39</ul> 40<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">TypeScript<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">JavaScript</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb hidden><div class=snack-player data-snack-name="Flex Direction" data-snack-description="Example usage" data-snack-files="%7B%22App.js%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20DirectionLayout%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5Bdirection%2C%20setDirection%5D%20%3D%20useState('ltr')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22direction%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7Bdirection%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B'ltr'%2C%20'rtl'%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetDirection%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'powderblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'skyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'steelblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7B%5Blabel%5D%3A%20selectedValue%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20DirectionLayout%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div><div role=tabpanel class=tabItem_wHwb><div class=snack-player data-snack-name="Flex Direction" data-snack-description="Example usage" data-snack-files="%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cnimport%20type%20%7BPropsWithChildren%7D%20from%20'react'%3B%5Cn%5Cnconst%20DirectionLayout%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5Bdirection%2C%20setDirection%5D%20%3D%20useState('ltr')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22direction%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7Bdirection%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B'ltr'%2C%20'rtl'%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetDirection%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'powderblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'skyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'steelblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cntype%20PreviewLayoutProps%20%3D%20PropsWithChildren%3C%7B%5Cn%20%20label%3A%20string%3B%5Cn%20%20values%3A%20string%5B%5D%3B%5Cn%20%20selectedValue%3A%20string%3B%5Cn%20%20setSelectedValue%3A%20(value%3A%20string)%20%3D%3E%20void%3B%5Cn%7D%3E%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D%3A%20PreviewLayoutProps)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7B%5Blabel%5D%3A%20selectedValue%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20DirectionLayout%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div></div></div> 41<h2 class="anchor anchorWithStickyNavbar_JmGV" id=justify-content>Justify Content<a href=#justify-content class=hash-link aria-label="Direct link to Justify Content" title="Direct link to Justify Content"></a></h2> 42<p><a href=/docs/layout-props#justifycontent><code>justifyContent</code></a> describes how to align children within the main axis of their container. For example, you can use this property to center a child horizontally within a container with <code>flexDirection</code> set to <code>row</code> or vertically within a container with <code>flexDirection</code> set to <code>column</code>.</p> 43<ul> 44<li> 45<p><code>flex-start</code>(<strong>default value</strong>) Align children of a container to the start of the container's main axis.</p> 46</li> 47<li> 48<p><code>flex-end</code> Align children of a container to the end of the container's main axis.</p> 49</li> 50<li> 51<p><code>center</code> Align children of a container in the center of the container's main axis.</p> 52</li> 53<li> 54<p><code>space-between</code> Evenly space off children across the container's main axis, distributing the remaining space between the children.</p> 55</li> 56<li> 57<p><code>space-around</code> Evenly space off children across the container's main axis, distributing the remaining space around the children. Compared to <code>space-between</code>, using <code>space-around</code> will result in space being distributed to the beginning of the first child and end of the last child.</p> 58</li> 59<li> 60<p><code>space-evenly</code> Evenly distribute children within the alignment container along the main axis. The spacing between each pair of adjacent items, the main-start edge and the first item, and the main-end edge and the last item, are all exactly the same.</p> 61</li> 62</ul> 63<p>You can learn more <a href=https://www.yogalayout.dev/docs/styling/justify-content target=_blank rel="noopener noreferrer">here</a>.</p> 64<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">TypeScript<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">JavaScript</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb hidden><div class=snack-player data-snack-name="Justify Content" data-snack-description="Example usage" data-snack-files="%7B%22App.js%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20JustifyContentBasics%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BjustifyContent%2C%20setJustifyContent%5D%20%3D%20useState('flex-start')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22justifyContent%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7BjustifyContent%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20'flex-start'%2C%5Cn%20%20%20%20%20%20%20%20'flex-end'%2C%5Cn%20%20%20%20%20%20%20%20'center'%2C%5Cn%20%20%20%20%20%20%20%20'space-between'%2C%5Cn%20%20%20%20%20%20%20%20'space-around'%2C%5Cn%20%20%20%20%20%20%20%20'space-evenly'%2C%5Cn%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetJustifyContent%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'powderblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'skyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'steelblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7B%5Blabel%5D%3A%20selectedValue%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20JustifyContentBasics%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div><div role=tabpanel class=tabItem_wHwb><div class=snack-player data-snack-name="Justify Content" data-snack-description="Example usage" data-snack-files="%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cnimport%20type%20%7BPropsWithChildren%7D%20from%20'react'%3B%5Cn%5Cnconst%20JustifyContentBasics%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BjustifyContent%2C%20setJustifyContent%5D%20%3D%20useState('flex-start')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22justifyContent%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7BjustifyContent%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20'flex-start'%2C%5Cn%20%20%20%20%20%20%20%20'flex-end'%2C%5Cn%20%20%20%20%20%20%20%20'center'%2C%5Cn%20%20%20%20%20%20%20%20'space-between'%2C%5Cn%20%20%20%20%20%20%20%20'space-around'%2C%5Cn%20%20%20%20%20%20%20%20'space-evenly'%2C%5Cn%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetJustifyContent%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'powderblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'skyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'steelblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cntype%20PreviewLayoutProps%20%3D%20PropsWithChildren%3C%7B%5Cn%20%20label%3A%20string%3B%5Cn%20%20values%3A%20string%5B%5D%3B%5Cn%20%20selectedValue%3A%20string%3B%5Cn%20%20setSelectedValue%3A%20(value%3A%20string)%20%3D%3E%20void%3B%5Cn%7D%3E%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D%3A%20PreviewLayoutProps)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7B%5Blabel%5D%3A%20selectedValue%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20JustifyContentBasics%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div></div></div> 65<h2 class="anchor anchorWithStickyNavbar_JmGV" id=align-items>Align Items<a href=#align-items class=hash-link aria-label="Direct link to Align Items" title="Direct link to Align Items"></a></h2> 66<p><a href=/docs/layout-props#alignitems><code>alignItems</code></a> describes how to align children along the cross axis of their container. It is very similar to <code>justifyContent</code> but instead of applying to the main axis, <code>alignItems</code> applies to the cross axis.</p> 67<ul> 68<li> 69<p><code>stretch</code> (<strong>default value</strong>) Stretch children of a container to match the <code>height</code> of the container's cross axis.</p> 70</li> 71<li> 72<p><code>flex-start</code> Align children of a container to the start of the container's cross axis.</p> 73</li> 74<li> 75<p><code>flex-end</code> Align children of a container to the end of the container's cross axis.</p> 76</li> 77<li> 78<p><code>center</code> Align children of a container in the center of the container's cross axis.</p> 79</li> 80<li> 81<p><code>baseline</code> Align children of a container along a common baseline. Individual children can be set to be the reference baseline for their parents.</p> 82</li> 83</ul> 84<div class="theme-admonition theme-admonition-info admonition_WCGJ alert alert--info"><div class=admonitionHeading_GCBg><span class=admonitionIcon_L39b><svg viewBox="0 0 14 16"><path fill-rule=evenodd d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"/></svg></span>info</div><div class=admonitionContent_pbrs><p>For <code>stretch</code> to have an effect, children must not have a fixed dimension along the secondary axis. In the following example, setting <code>alignItems: stretch</code> does nothing until the <code>width: 50</code> is removed from the children.</div></div> 85<p>You can learn more <a href=https://www.yogalayout.dev/docs/styling/align-items-self target=_blank rel="noopener noreferrer">here</a>.</p> 86<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">TypeScript<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">JavaScript</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb hidden><div class=snack-player data-snack-name="Align Items" data-snack-description="Example usage" data-snack-files="%7B%22App.js%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20AlignItemsLayout%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BalignItems%2C%20setAlignItems%5D%20%3D%20useState('stretch')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22alignItems%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7BalignItems%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B'stretch'%2C%20'flex-start'%2C%20'flex-end'%2C%20'center'%2C%20'baseline'%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetAlignItems%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'powderblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'skyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'steelblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20width%3A%20'auto'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20minWidth%3A%2050%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7B%5Blabel%5D%3A%20selectedValue%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20minHeight%3A%20200%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20AlignItemsLayout%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div><div role=tabpanel class=tabItem_wHwb><div class=snack-player data-snack-name="Align Items" data-snack-description="Example usage" data-snack-files="%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cnimport%20type%20%7BPropsWithChildren%7D%20from%20'react'%3B%5Cn%5Cnconst%20AlignItemsLayout%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BalignItems%2C%20setAlignItems%5D%20%3D%20useState('stretch')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22alignItems%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7BalignItems%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B'stretch'%2C%20'flex-start'%2C%20'flex-end'%2C%20'center'%2C%20'baseline'%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetAlignItems%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'powderblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'skyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'steelblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20width%3A%20'auto'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20minWidth%3A%2050%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cntype%20PreviewLayoutProps%20%3D%20PropsWithChildren%3C%7B%5Cn%20%20label%3A%20string%3B%5Cn%20%20values%3A%20string%5B%5D%3B%5Cn%20%20selectedValue%3A%20string%3B%5Cn%20%20setSelectedValue%3A%20(value%3A%20string)%20%3D%3E%20void%3B%5Cn%7D%3E%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D%3A%20PreviewLayoutProps)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7B%5Blabel%5D%3A%20selectedValue%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20minHeight%3A%20200%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20AlignItemsLayout%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div></div></div> 87<h2 class="anchor anchorWithStickyNavbar_JmGV" id=align-self>Align Self<a href=#align-self class=hash-link aria-label="Direct link to Align Self" title="Direct link to Align Self"></a></h2> 88<p><a href=/docs/layout-props#alignself><code>alignSelf</code></a> has the same options and effect as <code>alignItems</code> but instead of affecting the children within a container, you can apply this property to a single child to change its alignment within its parent. <code>alignSelf</code> overrides any option set by the parent with <code>alignItems</code>.</p> 89<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">TypeScript<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">JavaScript</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb hidden><div class=snack-player data-snack-name="Align Self" data-snack-description="Example usage" data-snack-files="%7B%22App.js%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20AlignSelfLayout%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BalignSelf%2C%20setAlignSelf%5D%20%3D%20useState('stretch')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22alignSelf%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7BalignSelf%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B'stretch'%2C%20'flex-start'%2C%20'flex-end'%2C%20'center'%2C%20'baseline'%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetAlignSelf%7D%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20alignSelf%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20width%3A%20'auto'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20minWidth%3A%2050%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'powderblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'skyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'steelblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.container%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20minHeight%3A%20200%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20AlignSelfLayout%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div><div role=tabpanel class=tabItem_wHwb><div class=snack-player data-snack-name="Align Self" data-snack-description="Example usage" data-snack-files="%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cnimport%20type%20%7BPropsWithChildren%7D%20from%20'react'%3B%5Cnimport%20type%20%7BFlexAlignType%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20AlignSelfLayout%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BalignSelf%2C%20setAlignSelf%5D%20%3D%20useState%3CFlexAlignType%3E('stretch')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22alignSelf%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7BalignSelf%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B'stretch'%2C%20'flex-start'%2C%20'flex-end'%2C%20'center'%2C%20'baseline'%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetAlignSelf%7D%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20alignSelf%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20width%3A%20'auto'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20minWidth%3A%2050%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'powderblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'skyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'steelblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cntype%20PreviewLayoutProps%20%3D%20PropsWithChildren%3C%7B%5Cn%20%20label%3A%20string%3B%5Cn%20%20values%3A%20FlexAlignType%5B%5D%3B%5Cn%20%20selectedValue%3A%20string%3B%5Cn%20%20setSelectedValue%3A%20(value%3A%20FlexAlignType)%20%3D%3E%20void%3B%5Cn%7D%3E%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D%3A%20PreviewLayoutProps)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.container%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20minHeight%3A%20200%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20AlignSelfLayout%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div></div></div> 90<h2 class="anchor anchorWithStickyNavbar_JmGV" id=align-content>Align Content<a href=#align-content class=hash-link aria-label="Direct link to Align Content" title="Direct link to Align Content"></a></h2> 91<p><a href=/docs/layout-props#aligncontent>alignContent</a> defines the distribution of lines along the cross-axis. This only has effect when items are wrapped to multiple lines using <code>flexWrap</code>.</p> 92<ul> 93<li> 94<p><code>flex-start</code> (<strong>default value</strong>) Align wrapped lines to the start of the container's cross axis.</p> 95</li> 96<li> 97<p><code>flex-end</code> Align wrapped lines to the end of the container's cross axis.</p> 98</li> 99<li> 100<p><code>stretch</code> (<em>default value when using Yoga on the web</em>) Stretch wrapped lines to match the height of the container's cross axis.</p> 101</li> 102<li> 103<p><code>center</code> Align wrapped lines in the center of the container's cross axis.</p> 104</li> 105<li> 106<p><code>space-between</code> Evenly space wrapped lines across the container's cross axis, distributing the remaining space between the lines.</p> 107</li> 108<li> 109<p><code>space-around</code> Evenly space wrapped lines across the container's cross axis, distributing the remaining space around the lines. Each end of the container has a half-sized space compared to the space between items.</p> 110</li> 111<li> 112<p><code>space-evenly</code> Evenly space wrapped lines across the container's cross axis, distributing the remaining space around the lines. Each space is the same size.</p> 113</li> 114</ul> 115<p>You can learn more <a href=https://www.yogalayout.dev/docs/styling/align-content target=_blank rel="noopener noreferrer">here</a>.</p> 116<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">TypeScript<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">JavaScript</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb hidden><div class=snack-player data-snack-name="Align Content" data-snack-description="Example usage" data-snack-files="%7B%22App.js%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20AlignContentLayout%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BalignContent%2C%20setAlignContent%5D%20%3D%20useState('flex-start')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22alignContent%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7BalignContent%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20'flex-start'%2C%5Cn%20%20%20%20%20%20%20%20'flex-end'%2C%5Cn%20%20%20%20%20%20%20%20'stretch'%2C%5Cn%20%20%20%20%20%20%20%20'center'%2C%5Cn%20%20%20%20%20%20%20%20'space-between'%2C%5Cn%20%20%20%20%20%20%20%20'space-around'%2C%5Cn%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetAlignContent%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'orangered'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'orange'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'mediumseagreen'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'deepskyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'mediumturquoise'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'mediumslateblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'purple'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7B%5Blabel%5D%3A%20selectedValue%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20maxHeight%3A%20400%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2080%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20AlignContentLayout%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div><div role=tabpanel class=tabItem_wHwb><div class=snack-player data-snack-name="Align Content" data-snack-description="Example usage" data-snack-files="%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cnimport%20type%20%7BPropsWithChildren%7D%20from%20'react'%3B%5Cn%5Cnconst%20AlignContentLayout%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BalignContent%2C%20setAlignContent%5D%20%3D%20useState('flex-start')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22alignContent%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7BalignContent%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20'flex-start'%2C%5Cn%20%20%20%20%20%20%20%20'flex-end'%2C%5Cn%20%20%20%20%20%20%20%20'stretch'%2C%5Cn%20%20%20%20%20%20%20%20'center'%2C%5Cn%20%20%20%20%20%20%20%20'space-between'%2C%5Cn%20%20%20%20%20%20%20%20'space-around'%2C%5Cn%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetAlignContent%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'orangered'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'orange'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'mediumseagreen'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'deepskyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'mediumturquoise'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'mediumslateblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'purple'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cntype%20PreviewLayoutProps%20%3D%20PropsWithChildren%3C%7B%5Cn%20%20label%3A%20string%3B%5Cn%20%20values%3A%20string%5B%5D%3B%5Cn%20%20selectedValue%3A%20string%3B%5Cn%20%20setSelectedValue%3A%20(value%3A%20string)%20%3D%3E%20void%3B%5Cn%7D%3E%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D%3A%20PreviewLayoutProps)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7B%5Blabel%5D%3A%20selectedValue%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20maxHeight%3A%20400%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2080%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20AlignContentLayout%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div></div></div> 117<h2 class="anchor anchorWithStickyNavbar_JmGV" id=flex-wrap>Flex Wrap<a href=#flex-wrap class=hash-link aria-label="Direct link to Flex Wrap" title="Direct link to Flex Wrap"></a></h2> 118<p>The <a href=/docs/layout-props#flexwrap><code>flexWrap</code></a> property is set on containers and it controls what happens when children overflow the size of the container along the main axis. By default, children are forced into a single line (which can shrink elements). If wrapping is allowed, items are wrapped into multiple lines along the main axis if needed.</p> 119<p>When wrapping lines, <code>alignContent</code> can be used to specify how the lines are placed in the container. Learn more <a href=https://www.yogalayout.dev/docs/styling/flex-wrap target=_blank rel="noopener noreferrer">here</a>.</p> 120<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">TypeScript<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">JavaScript</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb hidden><div class=snack-player data-snack-name="Flex Wrap" data-snack-description="Example usage" data-snack-files="%7B%22App.js%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20FlexWrapLayout%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BflexWrap%2C%20setFlexWrap%5D%20%3D%20useState('wrap')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22flexWrap%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7BflexWrap%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B'wrap'%2C%20'nowrap'%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetFlexWrap%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'orangered'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'orange'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'mediumseagreen'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'deepskyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'mediumturquoise'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'mediumslateblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'purple'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7B%5Blabel%5D%3A%20selectedValue%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20maxHeight%3A%20400%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2080%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20FlexWrapLayout%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div><div role=tabpanel class=tabItem_wHwb><div class=snack-player data-snack-name="Flex Wrap" data-snack-description="Example usage" data-snack-files="%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cnimport%20type%20%7BPropsWithChildren%7D%20from%20'react'%3B%5Cn%5Cnconst%20FlexWrapLayout%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BflexWrap%2C%20setFlexWrap%5D%20%3D%20useState('wrap')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22flexWrap%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7BflexWrap%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B'wrap'%2C%20'nowrap'%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetFlexWrap%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'orangered'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'orange'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'mediumseagreen'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'deepskyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'mediumturquoise'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'mediumslateblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'purple'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cntype%20PreviewLayoutProps%20%3D%20PropsWithChildren%3C%7B%5Cn%20%20label%3A%20string%3B%5Cn%20%20values%3A%20string%5B%5D%3B%5Cn%20%20selectedValue%3A%20string%3B%5Cn%20%20setSelectedValue%3A%20(value%3A%20string)%20%3D%3E%20void%3B%5Cn%7D%3E%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D%3A%20PreviewLayoutProps)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7B%5Blabel%5D%3A%20selectedValue%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20maxHeight%3A%20400%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2080%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20FlexWrapLayout%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div></div></div> 121<h2 class="anchor anchorWithStickyNavbar_JmGV" id=flex-basis-grow-and-shrink>Flex Basis, Grow, and Shrink<a href=#flex-basis-grow-and-shrink class=hash-link aria-label="Direct link to Flex Basis, Grow, and Shrink" title="Direct link to Flex Basis, Grow, and Shrink"></a></h2> 122<ul> 123<li> 124<p><a href=/docs/layout-props#flexbasis><code>flexBasis</code></a> is an axis-independent way of providing the default size of an item along the main axis. Setting the <code>flexBasis</code> of a child is similar to setting the <code>width</code> of that child if its parent is a container with <code>flexDirection: row</code> or setting the <code>height</code> of a child if its parent is a container with <code>flexDirection: column</code>. The <code>flexBasis</code> of an item is the default size of that item, the size of the item before any <code>flexGrow</code> and <code>flexShrink</code> calculations are performed.</p> 125</li> 126<li> 127<p><a href=/docs/layout-props#flexgrow><code>flexGrow</code></a> describes how much space within a container should be distributed among its children along the main axis. After laying out its children, a container will distribute any remaining space according to the flex grow values specified by its children.</p> 128<p><code>flexGrow</code> accepts any floating point value >= 0, with 0 being the default value. A container will distribute any remaining space among its children weighted by the children’s <code>flexGrow</code> values.</p> 129</li> 130<li> 131<p><a href=/docs/layout-props#flexshrink><code>flexShrink</code></a> describes how to shrink children along the main axis in the case in which the total size of the children overflows the size of the container on the main axis. <code>flexShrink</code> is very similar to <code>flexGrow</code> and can be thought of in the same way if any overflowing size is considered to be negative remaining space. These two properties also work well together by allowing children to grow and shrink as needed.</p> 132<p><code>flexShrink</code> accepts any floating point value >= 0, with 0 being the default value (on the web, the default is 1). A container will shrink its children weighted by the children’s <code>flexShrink</code> values.</p> 133</li> 134</ul> 135<p>You can learn more <a href=https://www.yogalayout.dev/docs/styling/flex-basis-grow-shrink target=_blank rel="noopener noreferrer">here</a>.</p> 136<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">TypeScript<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">JavaScript</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb hidden><div class=snack-player data-snack-name="Flex Basis, Grow, and Shrink" data-snack-description="Example usage" data-snack-files="%7B%22App.js%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20Text%2C%20TextInput%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20App%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5Bpowderblue%2C%20setPowderblue%5D%20%3D%20useState(%7B%5Cn%20%20%20%20flexGrow%3A%200%2C%5Cn%20%20%20%20flexShrink%3A%201%2C%5Cn%20%20%20%20flexBasis%3A%20'auto'%2C%5Cn%20%20%7D)%3B%5Cn%20%20const%20%5Bskyblue%2C%20setSkyblue%5D%20%3D%20useState(%7B%5Cn%20%20%20%20flexGrow%3A%201%2C%5Cn%20%20%20%20flexShrink%3A%200%2C%5Cn%20%20%20%20flexBasis%3A%20100%2C%5Cn%20%20%7D)%3B%5Cn%20%20const%20%5Bsteelblue%2C%20setSteelblue%5D%20%3D%20useState(%7B%5Cn%20%20%20%20flexGrow%3A%200%2C%5Cn%20%20%20%20flexShrink%3A%201%2C%5Cn%20%20%20%20flexBasis%3A%20200%2C%5Cn%20%20%7D)%3B%5Cn%20%20return%20(%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.container%7D%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20styles.container%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20alignContent%3A%20'space-between'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CBoxInfo%20color%3D%5C%22powderblue%5C%22%20%7B...powderblue%7D%20setStyle%3D%7BsetPowderblue%7D%20%2F%3E%5Cn%20%20%20%20%20%20%20%20%3CBoxInfo%20color%3D%5C%22skyblue%5C%22%20%7B...skyblue%7D%20setStyle%3D%7BsetSkyblue%7D%20%2F%3E%5Cn%20%20%20%20%20%20%20%20%3CBoxInfo%20color%3D%5C%22steelblue%5C%22%20%7B...steelblue%7D%20setStyle%3D%7BsetSteelblue%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7Bstyles.previewContainer%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexBasis%3A%20powderblue.flexBasis%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexGrow%3A%20powderblue.flexGrow%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexShrink%3A%20powderblue.flexShrink%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'powderblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexBasis%3A%20skyblue.flexBasis%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexGrow%3A%20skyblue.flexGrow%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexShrink%3A%20skyblue.flexShrink%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'skyblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexBasis%3A%20steelblue.flexBasis%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexGrow%3A%20steelblue.flexGrow%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexShrink%3A%20steelblue.flexShrink%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'steelblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20BoxInfo%20%3D%20(%7Bcolor%2C%20flexBasis%2C%20flexShrink%2C%20setStyle%2C%20flexGrow%7D)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%5Bstyles.row%2C%20%7BflexDirection%3A%20'column'%7D%5D%7D%3E%5Cn%20%20%20%20%3CView%5Cn%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20styles.boxLabel%2C%5Cn%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20color%2C%5Cn%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20style%3D%7B%7B%5Cn%20%20%20%20%20%20%20%20%20%20color%3A%20'%23fff'%2C%5Cn%20%20%20%20%20%20%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20%20%20%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20%20%20%20%20%7D%7D%3E%5Cn%20%20%20%20%20%20%20%20Box%5Cn%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3EflexBasis%3C%2FText%3E%5Cn%20%20%20%20%3CTextInput%5Cn%20%20%20%20%20%20value%3D%7BflexBasis%7D%5Cn%20%20%20%20%20%20style%3D%7Bstyles.input%7D%5Cn%20%20%20%20%20%20onChangeText%3D%7BfB%20%3D%3E%5Cn%20%20%20%20%20%20%20%20setStyle(value%20%3D%3E%20(%7B%5Cn%20%20%20%20%20%20%20%20%20%20...value%2C%5Cn%20%20%20%20%20%20%20%20%20%20flexBasis%3A%20isNaN(parseInt(fB%2C%2010))%20%3F%20'auto'%20%3A%20parseInt(fB%2C%2010)%2C%5Cn%20%20%20%20%20%20%20%20%7D))%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%2F%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3EflexShrink%3C%2FText%3E%5Cn%20%20%20%20%3CTextInput%5Cn%20%20%20%20%20%20value%3D%7BflexShrink%7D%5Cn%20%20%20%20%20%20style%3D%7Bstyles.input%7D%5Cn%20%20%20%20%20%20onChangeText%3D%7BfS%20%3D%3E%5Cn%20%20%20%20%20%20%20%20setStyle(value%20%3D%3E%20(%7B%5Cn%20%20%20%20%20%20%20%20%20%20...value%2C%5Cn%20%20%20%20%20%20%20%20%20%20flexShrink%3A%20isNaN(parseInt(fS%2C%2010))%20%3F%20undefined%20%3A%20parseInt(fS%2C%2010)%2C%5Cn%20%20%20%20%20%20%20%20%7D))%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%2F%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3EflexGrow%3C%2FText%3E%5Cn%20%20%20%20%3CTextInput%5Cn%20%20%20%20%20%20value%3D%7BflexGrow%7D%5Cn%20%20%20%20%20%20style%3D%7Bstyles.input%7D%5Cn%20%20%20%20%20%20onChangeText%3D%7BfG%20%3D%3E%5Cn%20%20%20%20%20%20%20%20setStyle(value%20%3D%3E%20(%7B%5Cn%20%20%20%20%20%20%20%20%20%20...value%2C%5Cn%20%20%20%20%20%20%20%20%20%20flexGrow%3A%20isNaN(parseInt(fG%2C%2010))%20%3F%20undefined%20%3A%20parseInt(fG%2C%2010)%2C%5Cn%20%20%20%20%20%20%20%20%7D))%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%2F%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20paddingHorizontal%3A%2010%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20boxLabel%3A%20%7B%5Cn%20%20%20%20minWidth%3A%2080%2C%5Cn%20%20%20%20padding%3A%208%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20marginTop%3A%206%2C%5Cn%20%20%20%20fontSize%3A%2016%2C%5Cn%20%20%20%20fontWeight%3A%20'100'%2C%5Cn%20%20%7D%2C%5Cn%20%20previewContainer%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%20%20alignItems%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%7D%2C%5Cn%20%20input%3A%20%7B%5Cn%20%20%20%20borderBottomWidth%3A%201%2C%5Cn%20%20%20%20paddingVertical%3A%203%2C%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20App%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div><div role=tabpanel class=tabItem_wHwb><div class=snack-player data-snack-name="Flex Basis, Grow, and Shrink" data-snack-description="Example usage" data-snack-files="%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20Text%2C%20TextInput%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cnimport%20type%20%7BViewStyle%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20App%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5Bpowderblue%2C%20setPowderblue%5D%20%3D%20useState%3CViewStyle%3E(%7B%5Cn%20%20%20%20flexGrow%3A%200%2C%5Cn%20%20%20%20flexShrink%3A%201%2C%5Cn%20%20%20%20flexBasis%3A%20'auto'%2C%5Cn%20%20%7D)%3B%5Cn%20%20const%20%5Bskyblue%2C%20setSkyblue%5D%20%3D%20useState%3CViewStyle%3E(%7B%5Cn%20%20%20%20flexGrow%3A%201%2C%5Cn%20%20%20%20flexShrink%3A%200%2C%5Cn%20%20%20%20flexBasis%3A%20100%2C%5Cn%20%20%7D)%3B%5Cn%20%20const%20%5Bsteelblue%2C%20setSteelblue%5D%20%3D%20useState%3CViewStyle%3E(%7B%5Cn%20%20%20%20flexGrow%3A%200%2C%5Cn%20%20%20%20flexShrink%3A%201%2C%5Cn%20%20%20%20flexBasis%3A%20200%2C%5Cn%20%20%7D)%3B%5Cn%20%20return%20(%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.container%7D%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20styles.container%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20alignContent%3A%20'space-between'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CBoxInfo%20color%3D%5C%22powderblue%5C%22%20%7B...powderblue%7D%20setStyle%3D%7BsetPowderblue%7D%20%2F%3E%5Cn%20%20%20%20%20%20%20%20%3CBoxInfo%20color%3D%5C%22skyblue%5C%22%20%7B...skyblue%7D%20setStyle%3D%7BsetSkyblue%7D%20%2F%3E%5Cn%20%20%20%20%20%20%20%20%3CBoxInfo%20color%3D%5C%22steelblue%5C%22%20%7B...steelblue%7D%20setStyle%3D%7BsetSteelblue%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7Bstyles.previewContainer%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexBasis%3A%20powderblue.flexBasis%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexGrow%3A%20powderblue.flexGrow%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexShrink%3A%20powderblue.flexShrink%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'powderblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexBasis%3A%20skyblue.flexBasis%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexGrow%3A%20skyblue.flexGrow%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexShrink%3A%20skyblue.flexShrink%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'skyblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexBasis%3A%20steelblue.flexBasis%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexGrow%3A%20steelblue.flexGrow%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20flexShrink%3A%20steelblue.flexShrink%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'steelblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cntype%20BoxInfoProps%20%3D%20ViewStyle%20%26%20%7B%5Cn%20%20color%3A%20string%3B%5Cn%20%20setStyle%3A%20React.Dispatch%3CReact.SetStateAction%3CViewStyle%3E%3E%3B%5Cn%7D%3B%5Cn%5Cnconst%20BoxInfo%20%3D%20(%7B%5Cn%20%20color%2C%5Cn%20%20flexBasis%2C%5Cn%20%20flexShrink%2C%5Cn%20%20setStyle%2C%5Cn%20%20flexGrow%2C%5Cn%7D%3A%20BoxInfoProps)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%5Bstyles.row%2C%20%7BflexDirection%3A%20'column'%7D%5D%7D%3E%5Cn%20%20%20%20%3CView%5Cn%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20styles.boxLabel%2C%5Cn%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20color%2C%5Cn%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20style%3D%7B%7B%5Cn%20%20%20%20%20%20%20%20%20%20color%3A%20'%23fff'%2C%5Cn%20%20%20%20%20%20%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20%20%20%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20%20%20%20%20%7D%7D%3E%5Cn%20%20%20%20%20%20%20%20Box%5Cn%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3EflexBasis%3C%2FText%3E%5Cn%20%20%20%20%3CTextInput%5Cn%20%20%20%20%20%20value%3D%7BString(flexBasis)%7D%5Cn%20%20%20%20%20%20style%3D%7Bstyles.input%7D%5Cn%20%20%20%20%20%20onChangeText%3D%7BfB%20%3D%3E%5Cn%20%20%20%20%20%20%20%20setStyle(value%20%3D%3E%20(%7B%5Cn%20%20%20%20%20%20%20%20%20%20...value%2C%5Cn%20%20%20%20%20%20%20%20%20%20flexBasis%3A%20isNaN(parseInt(fB%2C%2010))%20%3F%20'auto'%20%3A%20parseInt(fB%2C%2010)%2C%5Cn%20%20%20%20%20%20%20%20%7D))%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%2F%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3EflexShrink%3C%2FText%3E%5Cn%20%20%20%20%3CTextInput%5Cn%20%20%20%20%20%20value%3D%7BString(flexShrink)%7D%5Cn%20%20%20%20%20%20style%3D%7Bstyles.input%7D%5Cn%20%20%20%20%20%20onChangeText%3D%7BfS%20%3D%3E%5Cn%20%20%20%20%20%20%20%20setStyle(value%20%3D%3E%20(%7B%5Cn%20%20%20%20%20%20%20%20%20%20...value%2C%5Cn%20%20%20%20%20%20%20%20%20%20flexShrink%3A%20isNaN(parseInt(fS%2C%2010))%20%3F%20undefined%20%3A%20parseInt(fS%2C%2010)%2C%5Cn%20%20%20%20%20%20%20%20%7D))%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%2F%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3EflexGrow%3C%2FText%3E%5Cn%20%20%20%20%3CTextInput%5Cn%20%20%20%20%20%20value%3D%7BString(flexGrow)%7D%5Cn%20%20%20%20%20%20style%3D%7Bstyles.input%7D%5Cn%20%20%20%20%20%20onChangeText%3D%7BfG%20%3D%3E%5Cn%20%20%20%20%20%20%20%20setStyle(value%20%3D%3E%20(%7B%5Cn%20%20%20%20%20%20%20%20%20%20...value%2C%5Cn%20%20%20%20%20%20%20%20%20%20flexGrow%3A%20isNaN(parseInt(fG%2C%2010))%20%3F%20undefined%20%3A%20parseInt(fG%2C%2010)%2C%5Cn%20%20%20%20%20%20%20%20%7D))%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%2F%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20paddingHorizontal%3A%2010%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20boxLabel%3A%20%7B%5Cn%20%20%20%20minWidth%3A%2080%2C%5Cn%20%20%20%20padding%3A%208%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20marginTop%3A%206%2C%5Cn%20%20%20%20fontSize%3A%2016%2C%5Cn%20%20%20%20fontWeight%3A%20'100'%2C%5Cn%20%20%7D%2C%5Cn%20%20previewContainer%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%20%20alignItems%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%7D%2C%5Cn%20%20input%3A%20%7B%5Cn%20%20%20%20borderBottomWidth%3A%201%2C%5Cn%20%20%20%20paddingVertical%3A%203%2C%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20App%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div></div></div> 137<h2 class="anchor anchorWithStickyNavbar_JmGV" id=row-gap-column-gap-and-gap>Row Gap, Column Gap and Gap<a href=#row-gap-column-gap-and-gap class=hash-link aria-label="Direct link to Row Gap, Column Gap and Gap" title="Direct link to Row Gap, Column Gap and Gap"></a></h2> 138<ul> 139<li> 140<p><a href=/docs/layout-props#rowgap><code>rowGap</code></a> sets the size of the gap (gutter) between an element's rows.</p> 141</li> 142<li> 143<p><a href=/docs/layout-props#columngap><code>columnGap</code></a> sets the size of the gap (gutter) between an element's columns.</p> 144</li> 145<li> 146<p><a href=/docs/layout-props#gap><code>gap</code></a> sets the size of the gap (gutter) between rows and columns. It is a shorthand for <code>rowGap</code> and <code>columnGap</code>.</p> 147</li> 148</ul> 149<p>You can use <code>flexWrap</code> and <code>alignContent</code> along with <code>gap</code> to add consistent spacing between items.</p> 150<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">TypeScript<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">JavaScript</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb hidden><div class=snack-player data-snack-name="Row Gap and Column Gap" data-snack-description="Example usage" data-snack-files="%7B%22App.js%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20Text%2C%20StyleSheet%2C%20TextInput%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20RowGapAndColumnGap%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BrowGap%2C%20setRowGap%5D%20%3D%20useState(10)%3B%5Cn%20%20const%20%5BcolumnGap%2C%20setColumnGap%5D%20%3D%20useState(10)%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20columnGap%3D%7BcolumnGap%7D%5Cn%20%20%20%20%20%20handleColumnGapChange%3D%7BsetColumnGap%7D%5Cn%20%20%20%20%20%20rowGap%3D%7BrowGap%7D%5Cn%20%20%20%20%20%20handleRowGapChange%3D%7BsetRowGap%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20styles.box1%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20styles.box2%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20styles.box3%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20styles.box4%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20styles.box5%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20children%2C%5Cn%20%20handleColumnGapChange%2C%5Cn%20%20handleRowGapChange%2C%5Cn%20%20rowGap%2C%5Cn%20%20columnGap%2C%5Cn%7D)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7Bstyles.previewContainer%7D%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.inputContainer%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7Bstyles.itemsCenter%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CText%3ERow%20Gap%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3CTextInput%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7Bstyles.input%7D%5Cn%20%20%20%20%20%20%20%20%20%20value%3D%7BrowGap%7D%5Cn%20%20%20%20%20%20%20%20%20%20onChangeText%3D%7Bv%20%3D%3E%20handleRowGapChange(Number(v))%7D%5Cn%20%20%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7Bstyles.itemsCenter%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CText%3EColumn%20Gap%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3CTextInput%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7Bstyles.input%7D%5Cn%20%20%20%20%20%20%20%20%20%20value%3D%7BcolumnGap%7D%5Cn%20%20%20%20%20%20%20%20%20%20onChangeText%3D%7Bv%20%3D%3E%20handleColumnGapChange(Number(v))%7D%5Cn%20%20%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7BrowGap%2C%20columnGap%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20itemsCenter%3A%20%7BalignItems%3A%20'center'%7D%2C%5Cn%20%20inputContainer%3A%20%7B%5Cn%20%20%20%20gap%3A%204%2C%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20justifyContent%3A%20'space-around'%2C%5Cn%20%20%7D%2C%5Cn%20%20previewContainer%3A%20%7Bpadding%3A%2010%2C%20flex%3A%201%7D%2C%5Cn%20%20input%3A%20%7B%5Cn%20%20%20%20borderBottomWidth%3A%201%2C%5Cn%20%20%20%20paddingVertical%3A%203%2C%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20maxHeight%3A%20400%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%20%20alignContent%3A%20'flex-start'%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2080%2C%5Cn%20%20%7D%2C%5Cn%20%20box1%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'orangered'%2C%5Cn%20%20%7D%2C%5Cn%20%20box2%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'orange'%2C%5Cn%20%20%7D%2C%5Cn%20%20box3%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'mediumseagreen'%2C%5Cn%20%20%7D%2C%5Cn%20%20box4%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'deepskyblue'%2C%5Cn%20%20%7D%2C%5Cn%20%20box5%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'mediumturquoise'%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20RowGapAndColumnGap%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div><div role=tabpanel class=tabItem_wHwb><div class=snack-player data-snack-name="Row Gap and Column Gap" data-snack-description="Example usage" data-snack-files="%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20Text%2C%20StyleSheet%2C%20TextInput%7D%20from%20'react-native'%3B%5Cnimport%20type%20%7BPropsWithChildren%7D%20from%20'react'%3B%5Cn%5Cnconst%20RowGapAndColumnGap%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BrowGap%2C%20setRowGap%5D%20%3D%20useState(10)%3B%5Cn%20%20const%20%5BcolumnGap%2C%20setColumnGap%5D%20%3D%20useState(10)%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20columnGap%3D%7BcolumnGap%7D%5Cn%20%20%20%20%20%20handleColumnGapChange%3D%7BsetColumnGap%7D%5Cn%20%20%20%20%20%20rowGap%3D%7BrowGap%7D%5Cn%20%20%20%20%20%20handleRowGapChange%3D%7BsetRowGap%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20styles.box1%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20styles.box2%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20styles.box3%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20styles.box4%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20styles.box5%5D%7D%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cntype%20PreviewLayoutProps%20%3D%20PropsWithChildren%3C%7B%5Cn%20%20columnGap%3A%20number%3B%5Cn%20%20handleColumnGapChange%3A%20(gap%3A%20number)%20%3D%3E%20void%3B%5Cn%20%20rowGap%3A%20number%3B%5Cn%20%20handleRowGapChange%3A%20(gap%3A%20number)%20%3D%3E%20void%3B%5Cn%7D%3E%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20children%2C%5Cn%20%20handleColumnGapChange%2C%5Cn%20%20handleRowGapChange%2C%5Cn%20%20rowGap%2C%5Cn%20%20columnGap%2C%5Cn%7D%3A%20PreviewLayoutProps)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7Bstyles.previewContainer%7D%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.inputContainer%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7Bstyles.itemsCenter%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CText%3ERow%20Gap%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3CTextInput%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7Bstyles.input%7D%5Cn%20%20%20%20%20%20%20%20%20%20value%3D%7BString(rowGap)%7D%5Cn%20%20%20%20%20%20%20%20%20%20onChangeText%3D%7Bv%20%3D%3E%20handleRowGapChange(Number(v))%7D%5Cn%20%20%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7Bstyles.itemsCenter%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CText%3EColumn%20Gap%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3CTextInput%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7Bstyles.input%7D%5Cn%20%20%20%20%20%20%20%20%20%20value%3D%7BString(columnGap)%7D%5Cn%20%20%20%20%20%20%20%20%20%20onChangeText%3D%7Bv%20%3D%3E%20handleColumnGapChange(Number(v))%7D%5Cn%20%20%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7B%5Bstyles.container%2C%20%7BrowGap%2C%20columnGap%7D%5D%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20itemsCenter%3A%20%7BalignItems%3A%20'center'%7D%2C%5Cn%20%20inputContainer%3A%20%7B%5Cn%20%20%20%20gap%3A%204%2C%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20justifyContent%3A%20'space-around'%2C%5Cn%20%20%7D%2C%5Cn%20%20previewContainer%3A%20%7Bpadding%3A%2010%2C%20flex%3A%201%7D%2C%5Cn%20%20input%3A%20%7B%5Cn%20%20%20%20borderBottomWidth%3A%201%2C%5Cn%20%20%20%20paddingVertical%3A%203%2C%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20maxHeight%3A%20400%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%20%20alignContent%3A%20'flex-start'%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2080%2C%5Cn%20%20%7D%2C%5Cn%20%20box1%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'orangered'%2C%5Cn%20%20%7D%2C%5Cn%20%20box2%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'orange'%2C%5Cn%20%20%7D%2C%5Cn%20%20box3%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'mediumseagreen'%2C%5Cn%20%20%7D%2C%5Cn%20%20box4%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'deepskyblue'%2C%5Cn%20%20%7D%2C%5Cn%20%20box5%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'mediumturquoise'%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20RowGapAndColumnGap%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div></div></div> 151<h2 class="anchor anchorWithStickyNavbar_JmGV" id=width-and-height>Width and Height<a href=#width-and-height class=hash-link aria-label="Direct link to Width and Height" title="Direct link to Width and Height"></a></h2> 152<p>The <code>width</code> property specifies the width of an element's content area. Similarly, the <code>height</code> property specifies the height of an element's content area.</p> 153<p>Both <code>width</code> and <code>height</code> can take the following values:</p> 154<ul> 155<li> 156<p><code>auto</code> (<strong>default value</strong>) React Native calculates the width/height for the element based on its content, whether that is other children, text, or an image.</p> 157</li> 158<li> 159<p><code>pixels</code> Defines the width/height in absolute pixels. Depending on other styles set on the component, this may or may not be the final dimension of the node.</p> 160</li> 161<li> 162<p><code>percentage</code> Defines the width or height in percentage of its parent's width or height, respectively.</p> 163</li> 164</ul> 165<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">TypeScript<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">JavaScript</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb hidden><div class=snack-player data-snack-name="Width and Height" data-snack-description="Example usage" data-snack-files="%7B%22App.js%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cnimport%20%7BSafeAreaView%2C%20SafeAreaProvider%7D%20from%20'react-native-safe-area-context'%3B%5Cn%5Cnconst%20WidthHeightBasics%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BwidthType%2C%20setWidthType%5D%20%3D%20useState('auto')%3B%5Cn%20%20const%20%5BheightType%2C%20setHeightType%5D%20%3D%20useState('auto')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20widthType%3D%7BwidthType%7D%5Cn%20%20%20%20%20%20heightType%3D%7BheightType%7D%5Cn%20%20%20%20%20%20widthValues%3D%7B%5B'auto'%2C%20300%2C%20'80%25'%5D%7D%5Cn%20%20%20%20%20%20heightValues%3D%7B%5B'auto'%2C%20200%2C%20'60%25'%5D%7D%5Cn%20%20%20%20%20%20setWidthType%3D%7BsetWidthType%7D%5Cn%20%20%20%20%20%20setHeightType%3D%7BsetHeightType%7D%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%7B%5Cn%20%20%20%20%20%20%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20height%3A%20heightType%2C%5Cn%20%20%20%20%20%20%20%20%20%20width%3A%20widthType%2C%5Cn%20%20%20%20%20%20%20%20%20%20padding%3A%2015%2C%5Cn%20%20%20%20%20%20%20%20%7D%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'powderblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'skyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'steelblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20children%2C%5Cn%20%20widthType%2C%5Cn%20%20heightType%2C%5Cn%20%20widthValues%2C%5Cn%20%20heightValues%2C%5Cn%20%20setWidthType%2C%5Cn%20%20setHeightType%2C%5Cn%7D)%20%3D%3E%20(%5Cn%20%20%3CSafeAreaProvider%3E%5Cn%20%20%20%20%3CSafeAreaView%20style%3D%7B%7Bflex%3A%201%2C%20padding%3A%2010%7D%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3Ewidth%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%7BwidthValues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setWidthType(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20widthType%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20widthType%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3Eheight%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%7BheightValues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setHeightType(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20heightType%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20heightType%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%20%20%7Bchildren%7D%5Cn%20%20%20%20%3C%2FSafeAreaView%3E%5Cn%20%20%3C%2FSafeAreaProvider%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20padding%3A%208%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginRight%3A%2010%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20shadowOpacity%3A%200%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20WidthHeightBasics%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div><div role=tabpanel class=tabItem_wHwb><div class=snack-player data-snack-name="Width and Height" data-snack-description="Example usage" data-snack-files="%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%2C%20PropsWithChildren%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cnimport%20%7BSafeAreaView%2C%20SafeAreaProvider%7D%20from%20'react-native-safe-area-context'%3B%5Cn%5Cntype%20Dimension%20%3D%20'auto'%20%7C%20%60%24%7Bnumber%7D%25%60%20%7C%20number%3B%5Cn%5Cnconst%20WidthHeightBasics%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5BwidthType%2C%20setWidthType%5D%20%3D%20useState%3CDimension%3E('auto')%3B%5Cn%20%20const%20%5BheightType%2C%20setHeightType%5D%20%3D%20useState%3CDimension%3E('auto')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20widthType%3D%7BwidthType%7D%5Cn%20%20%20%20%20%20heightType%3D%7BheightType%7D%5Cn%20%20%20%20%20%20widthValues%3D%7B%5B'auto'%2C%20300%2C%20'80%25'%5D%7D%5Cn%20%20%20%20%20%20heightValues%3D%7B%5B'auto'%2C%20200%2C%20'60%25'%5D%7D%5Cn%20%20%20%20%20%20setWidthType%3D%7BsetWidthType%7D%5Cn%20%20%20%20%20%20setHeightType%3D%7BsetHeightType%7D%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%7B%5Cn%20%20%20%20%20%20%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20height%3A%20heightType%2C%5Cn%20%20%20%20%20%20%20%20%20%20width%3A%20widthType%2C%5Cn%20%20%20%20%20%20%20%20%20%20padding%3A%2015%2C%5Cn%20%20%20%20%20%20%20%20%7D%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'powderblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'skyblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%20%20%3CView%20style%3D%7B%5Bstyles.box%2C%20%7BbackgroundColor%3A%20'steelblue'%7D%5D%7D%20%2F%3E%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cntype%20PreviewLayoutProps%20%3D%20PropsWithChildren%3C%7B%5Cn%20%20widthType%3A%20Dimension%3B%5Cn%20%20heightType%3A%20Dimension%3B%5Cn%20%20widthValues%3A%20Dimension%5B%5D%3B%5Cn%20%20heightValues%3A%20Dimension%5B%5D%3B%5Cn%20%20setWidthType%3A%20(value%3A%20Dimension)%20%3D%3E%20void%3B%5Cn%20%20setHeightType%3A%20(value%3A%20Dimension)%20%3D%3E%20void%3B%5Cn%7D%3E%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20children%2C%5Cn%20%20widthType%2C%5Cn%20%20heightType%2C%5Cn%20%20widthValues%2C%5Cn%20%20heightValues%2C%5Cn%20%20setWidthType%2C%5Cn%20%20setHeightType%2C%5Cn%7D%3A%20PreviewLayoutProps)%20%3D%3E%20(%5Cn%20%20%3CSafeAreaProvider%3E%5Cn%20%20%20%20%3CSafeAreaView%20style%3D%7B%7Bflex%3A%201%2C%20padding%3A%2010%7D%7D%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3Ewidth%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%7BwidthValues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setWidthType(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20widthType%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20widthType%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3Eheight%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%7BheightValues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setHeightType(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20heightType%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20heightType%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%20%20%7Bchildren%7D%5Cn%20%20%20%20%3C%2FSafeAreaView%3E%5Cn%20%20%3C%2FSafeAreaProvider%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20padding%3A%208%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginRight%3A%2010%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20shadowOpacity%3A%200%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20WidthHeightBasics%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div></div></div> 166<h2 class="anchor anchorWithStickyNavbar_JmGV" id=position>Position<a href=#position class=hash-link aria-label="Direct link to Position" title="Direct link to Position"></a></h2> 167<p>The <code>position</code> type of an element defines how it is positioned relative to either itself, its parent, or its <a href=/docs/flexbox#the-containing-block>containing block</a>.</p> 168<ul> 169<li> 170<p><code>relative</code> (<strong>default value</strong>) By default, an element is positioned relatively. This means an element is positioned according to the normal flow of the layout, and then offset relative to that position based on the values of <code>top</code>, <code>right</code>, <code>bottom</code>, and <code>left</code>. The offset does not affect the position of any sibling or parent elements.</p> 171</li> 172<li> 173<p><code>absolute</code> When positioned absolutely, an element doesn't take part in the normal layout flow. It is instead laid out independent of its siblings. The position is determined based on the <code>top</code>, <code>right</code>, <code>bottom</code>, and <code>left</code> values. These values will position the element relative to its containing block.</p> 174</li> 175<li> 176<p><code>static</code> When positioned statically, an element is positioned according to the normal flow of layout, and will ignore the <code>top</code>, <code>right</code>, <code>bottom</code>, and <code>left</code> values. This <code>position</code> will also cause the element to not form a containing block for absolute descendants, unless some other superceding style prop is present (e.g. <code>transform</code>). This allows <code>absolute</code> elements to be positioned to something that is not their parent. Note that <strong><code>static</code> is only available on the New Architecture</strong>.</p> 177</li> 178</ul> 179<div class="tabs-container tabList_J5MA"><ul role=tablist aria-orientation=horizontal class=tabs><li role=tab tabindex=0 aria-selected=true class="tabs__item tabItem_l0OV tabs__item--active">TypeScript<li role=tab tabindex=-1 aria-selected=false class="tabs__item tabItem_l0OV">JavaScript</ul><div class=margin-top--md><div role=tabpanel class=tabItem_wHwb hidden><div class=snack-player data-snack-name=Position data-snack-description="Example usage" data-snack-files="%7B%22App.js%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cn%5Cnconst%20PositionLayout%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5Bposition%2C%20setPosition%5D%20%3D%20useState('relative')%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22position%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7Bposition%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B'relative'%2C%20'absolute'%2C%20'static'%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetPosition%7D%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20top%3A%2025%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20left%3A%2025%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20position%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'powderblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20top%3A%2050%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20left%3A%2050%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20position%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'skyblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20top%3A%2075%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20left%3A%2075%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20position%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'steelblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.container%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20minHeight%3A%20200%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20PositionLayout%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div><div role=tabpanel class=tabItem_wHwb><div class=snack-player data-snack-name=Position data-snack-description="Example usage" data-snack-files="%7B%22App.tsx%22%3A%7B%22type%22%3A%22CODE%22%2C%22contents%22%3A%22import%20React%2C%20%7BuseState%7D%20from%20'react'%3B%5Cnimport%20%7BView%2C%20TouchableOpacity%2C%20Text%2C%20StyleSheet%7D%20from%20'react-native'%3B%5Cnimport%20type%20%7BPropsWithChildren%7D%20from%20'react'%3B%5Cn%5Cnconst%20PositionLayout%20%3D%20()%20%3D%3E%20%7B%5Cn%20%20const%20%5Bposition%2C%20setPosition%5D%20%3D%20useState%3C'relative'%20%7C%20'absolute'%20%7C%20'static'%3E(%5Cn%20%20%20%20'relative'%2C%5Cn%20%20)%3B%5Cn%5Cn%20%20return%20(%5Cn%20%20%20%20%3CPreviewLayout%5Cn%20%20%20%20%20%20label%3D%5C%22position%5C%22%5Cn%20%20%20%20%20%20selectedValue%3D%7Bposition%7D%5Cn%20%20%20%20%20%20values%3D%7B%5B'relative'%2C%20'absolute'%2C%20'static'%5D%7D%5Cn%20%20%20%20%20%20setSelectedValue%3D%7BsetPosition%7D%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20top%3A%2025%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20left%3A%2025%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20position%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'powderblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20top%3A%2050%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20left%3A%2050%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20position%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'skyblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%20%20%3CView%5Cn%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20styles.box%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20top%3A%2075%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20left%3A%2075%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20position%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20backgroundColor%3A%20'steelblue'%2C%5Cn%20%20%20%20%20%20%20%20%20%20%7D%2C%5Cn%20%20%20%20%20%20%20%20%5D%7D%5Cn%20%20%20%20%20%20%2F%3E%5Cn%20%20%20%20%3C%2FPreviewLayout%3E%5Cn%20%20)%3B%5Cn%7D%3B%5Cn%5Cntype%20PreviewLayoutProps%20%3D%20PropsWithChildren%3C%7B%5Cn%20%20label%3A%20string%3B%5Cn%20%20values%3A%20Array%3C'relative'%20%7C%20'absolute'%20%7C%20'static'%3E%3B%5Cn%20%20selectedValue%3A%20string%3B%5Cn%20%20setSelectedValue%3A%20(value%3A%20'relative'%20%7C%20'absolute'%20%7C%20'static')%20%3D%3E%20void%3B%5Cn%7D%3E%3B%5Cn%5Cnconst%20PreviewLayout%20%3D%20(%7B%5Cn%20%20label%2C%5Cn%20%20children%2C%5Cn%20%20values%2C%5Cn%20%20selectedValue%2C%5Cn%20%20setSelectedValue%2C%5Cn%7D%3A%20PreviewLayoutProps)%20%3D%3E%20(%5Cn%20%20%3CView%20style%3D%7B%7Bpadding%3A%2010%2C%20flex%3A%201%7D%7D%3E%5Cn%20%20%20%20%3CText%20style%3D%7Bstyles.label%7D%3E%7Blabel%7D%3C%2FText%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.row%7D%3E%5Cn%20%20%20%20%20%20%7Bvalues.map(value%20%3D%3E%20(%5Cn%20%20%20%20%20%20%20%20%3CTouchableOpacity%5Cn%20%20%20%20%20%20%20%20%20%20key%3D%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20onPress%3D%7B()%20%3D%3E%20setSelectedValue(value)%7D%5Cn%20%20%20%20%20%20%20%20%20%20style%3D%7B%5Bstyles.button%2C%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selected%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%3CText%5Cn%20%20%20%20%20%20%20%20%20%20%20%20style%3D%7B%5B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20styles.buttonLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20selectedValue%20%3D%3D%3D%20value%20%26%26%20styles.selectedLabel%2C%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%5D%7D%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7Bvalue%7D%5Cn%20%20%20%20%20%20%20%20%20%20%3C%2FText%3E%5Cn%20%20%20%20%20%20%20%20%3C%2FTouchableOpacity%3E%5Cn%20%20%20%20%20%20))%7D%5Cn%20%20%20%20%3C%2FView%3E%5Cn%20%20%20%20%3CView%20style%3D%7Bstyles.container%7D%3E%7Bchildren%7D%3C%2FView%3E%5Cn%20%20%3C%2FView%3E%5Cn)%3B%5Cn%5Cnconst%20styles%20%3D%20StyleSheet.create(%7B%5Cn%20%20container%3A%20%7B%5Cn%20%20%20%20flex%3A%201%2C%5Cn%20%20%20%20marginTop%3A%208%2C%5Cn%20%20%20%20backgroundColor%3A%20'aliceblue'%2C%5Cn%20%20%20%20minHeight%3A%20200%2C%5Cn%20%20%7D%2C%5Cn%20%20box%3A%20%7B%5Cn%20%20%20%20width%3A%2050%2C%5Cn%20%20%20%20height%3A%2050%2C%5Cn%20%20%7D%2C%5Cn%20%20row%3A%20%7B%5Cn%20%20%20%20flexDirection%3A%20'row'%2C%5Cn%20%20%20%20flexWrap%3A%20'wrap'%2C%5Cn%20%20%7D%2C%5Cn%20%20button%3A%20%7B%5Cn%20%20%20%20paddingHorizontal%3A%208%2C%5Cn%20%20%20%20paddingVertical%3A%206%2C%5Cn%20%20%20%20borderRadius%3A%204%2C%5Cn%20%20%20%20backgroundColor%3A%20'oldlace'%2C%5Cn%20%20%20%20alignSelf%3A%20'flex-start'%2C%5Cn%20%20%20%20marginHorizontal%3A%20'1%25'%2C%5Cn%20%20%20%20marginBottom%3A%206%2C%5Cn%20%20%20%20minWidth%3A%20'48%25'%2C%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%7D%2C%5Cn%20%20selected%3A%20%7B%5Cn%20%20%20%20backgroundColor%3A%20'coral'%2C%5Cn%20%20%20%20borderWidth%3A%200%2C%5Cn%20%20%7D%2C%5Cn%20%20buttonLabel%3A%20%7B%5Cn%20%20%20%20fontSize%3A%2012%2C%5Cn%20%20%20%20fontWeight%3A%20'500'%2C%5Cn%20%20%20%20color%3A%20'coral'%2C%5Cn%20%20%7D%2C%5Cn%20%20selectedLabel%3A%20%7B%5Cn%20%20%20%20color%3A%20'white'%2C%5Cn%20%20%7D%2C%5Cn%20%20label%3A%20%7B%5Cn%20%20%20%20textAlign%3A%20'center'%2C%5Cn%20%20%20%20marginBottom%3A%2010%2C%5Cn%20%20%20%20fontSize%3A%2024%2C%5Cn%20%20%7D%2C%5Cn%7D)%3B%5Cn%5Cnexport%20default%20PositionLayout%3B%22%7D%7D" data-snack-dependencies=react-native-safe-area-context data-snack-platform=web data-snack-supported-platforms=ios,android,web data-snack-theme=light data-snack-preview=true data-snack-loading=lazy data-snack-device-frame=false></div></div></div></div> 180<h2 class="anchor anchorWithStickyNavbar_JmGV" id=the-containing-block>The Containing Block<a href=#the-containing-block class=hash-link aria-label="Direct link to The Containing Block" title="Direct link to The Containing Block"></a></h2> 181<p>The containing block of an element is an ancestor element which controls its position and size. 182The way containing blocks work in React Native is very similar to <a href=https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block target=_blank rel="noopener noreferrer">how they work on the web</a>, with some simplifications due to the lack of some web features.</p> 183<p>The <code>top</code>, <code>right</code>, <code>bottom</code>, and <code>left</code> values of an absolutely positioned element will be 184relative to its containing block.</p> 185<p>Percentage lengths (e.g.: <code>width: '50%'</code> or <code>padding: '10%'</code>) applied to absolutely positioned elements will be calculated relatively to the size of its containing block. For example, if the containing block is 100 points wide, then <code>width: 50%</code> on an absolutely positioned element will cause it to be 50 points wide.</p> 186<p>The following list will help you determine the containing block of any given element:</p> 187<ul> 188<li>If that element has a <code>position</code> type of <code>relative</code> or <code>static</code>, then its containing block is its parent.</li> 189<li>If that element has a <code>position</code> type of <code>absolute</code>, then its containing block is the nearest ancestor in which one of the following is true:<!-- --> 190<ul> 191<li>It has a <code>position</code> type other than <code>static</code></li> 192<li>It has a <code>transform</code></li> 193</ul> 194</li> 195</ul> 196<h2 class="anchor anchorWithStickyNavbar_JmGV" id=going-deeper>Going Deeper<a href=#going-deeper class=hash-link aria-label="Direct link to Going Deeper" title="Direct link to Going Deeper"></a></h2> 197<p>Check out the interactive <a href=https://www.yogalayout.dev/playground target=_blank rel="noopener noreferrer">yoga playground</a> that you can use to get a better understanding of flexbox.</p> 198<p>We've covered the basics, but there are many other styles you may need for layouts. The full list of props that control layout is documented <a href=/docs/layout-props>here</a>.</p> 199<p>Additionally, you can see some examples from <a href=https://medium.com/wix-engineering/the-full-react-native-layout-cheat-sheet-a4147802405c target=_blank rel="noopener noreferrer">Wix Engineers</a>.</div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class=editButtons_t0bR><a href=https://github.com/facebook/react-native-website/edit/main/docs/flexbox.md target=_blank rel="noopener noreferrer" class=theme-edit-this-page><svg fill=currentColor height=20 width=20 viewBox="0 0 40 40" class=iconEdit_bHB7 aria-hidden=true><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"/></g></svg>Edit page for next release</a><a href=https://github.com/facebook/react-native-website/edit/main/website/versioned_docs/version-0.79/flexbox.md target=_blank rel="noopener noreferrer" class=theme-edit-this-page><svg fill=currentColor height=20 width=20 viewBox="0 0 40 40" class=iconEdit_bHB7 aria-hidden=true><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"/></g></svg>Edit page for current release</a></div><div class=lastUpdated_VsjB><span class=theme-last-updated>Last updated<!-- --> on <b><time datetime=2025-04-14T14:14:17.000Z itemprop=dateModified>Apr 14, 2025</time></b></span></div></div></footer></article><nav class="docusaurus-mt-lg pagination-nav" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href=/docs/height-and-width><div class=pagination-nav__sublabel>Previous</div><div class=pagination-nav__label>Height and Width</div></a><a class="pagination-nav__link pagination-nav__link--next" href=/docs/images><div class=pagination-nav__sublabel>Next</div><div class=pagination-nav__label>Images</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_XG6w thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href=#flex class="table-of-contents__link toc-highlight">Flex</a><li><a href=#flex-direction class="table-of-contents__link toc-highlight">Flex Direction</a><li><a href=#layout-direction class="table-of-contents__link toc-highlight">Layout Direction</a><li><a href=#justify-content class="table-of-contents__link toc-highlight">Justify Content</a><li><a href=#align-items class="table-of-contents__link toc-highlight">Align Items</a><li><a href=#align-self class="table-of-contents__link toc-highlight">Align Self</a><li><a href=#align-content class="table-of-contents__link toc-highlight">Align Content</a><li><a href=#flex-wrap class="table-of-contents__link toc-highlight">Flex Wrap</a><li><a href=#flex-basis-grow-and-shrink class="table-of-contents__link toc-highlight">Flex Basis, Grow, and Shrink</a><li><a href=#row-gap-column-gap-and-gap class="table-of-contents__link toc-highlight">Row Gap, Column Gap and Gap</a><li><a href=#width-and-height class="table-of-contents__link toc-highlight">Width and Height</a><li><a href=#position class="table-of-contents__link toc-highlight">Position</a><li><a href=#the-containing-block class="table-of-contents__link toc-highlight">The Containing Block</a><li><a href=#going-deeper class="table-of-contents__link toc-highlight">Going Deeper</a></ul></div></div></div></div></main></div></div></div><footer class="theme-layout-footer footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="theme-layout-footer-column col footer__col"><div class=footer__title>Develop</div><ul class="footer__items clean-list"><li class=footer__item><a class=footer__link-item href=/docs/getting-started>Guides</a><li class=footer__item><a class=footer__link-item href=/docs/components-and-apis>Components</a><li class=footer__item><a class=footer__link-item href=/docs/accessibilityinfo>APIs</a><li class=footer__item><a class=footer__link-item href=/architecture/overview>Architecture</a></ul></div><div class="theme-layout-footer-column col footer__col"><div class=footer__title>Participate</div><ul class="footer__items clean-list"><li class=footer__item><a class=footer__link-item href=/showcase>Showcase</a><li class=footer__item><a class=footer__link-item href=/contributing/overview>Contributing</a><li class=footer__item><a class=footer__link-item href=/community/overview>Community</a><li class=footer__item><a href=https://reactnative.directory/ target=_blank rel="noopener noreferrer" class=footer__link-item>Directory<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a><li class=footer__item><a href=https://stackoverflow.com/questions/tagged/react-native target=_blank rel="noopener noreferrer" class=footer__link-item>Stack Overflow<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a></ul></div><div class="theme-layout-footer-column col footer__col"><div class=footer__title>Find us</div><ul class="footer__items clean-list"><li class=footer__item><a class=footer__link-item href=/blog>Blog</a><li class=footer__item><a href=https://x.com/reactnative target=_blank rel="noopener noreferrer" class=footer__link-item>X<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a><li class=footer__item><a href=https://bsky.app/profile/reactnative.dev target=_blank rel="noopener noreferrer" class=footer__link-item>Bluesky<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a><li class=footer__item><a href=https://github.com/facebook/react-native target=_blank rel="noopener noreferrer" class=footer__link-item>GitHub<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a></ul></div><div class="theme-layout-footer-column col footer__col"><div class=footer__title>Explore More</div><ul class="footer__items clean-list"><li class=footer__item><a href=https://react.dev/ target=_blank rel="noopener noreferrer" class=footer__link-item>ReactJS<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a><li class=footer__item><a href=https://opensource.fb.com/legal/privacy/ target=_blank rel="noopener noreferrer" class=footer__link-item>Privacy Policy<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a><li class=footer__item><a href=https://opensource.fb.com/legal/terms/ target=_blank rel="noopener noreferrer" class=footer__link-item>Terms of Service<svg width=13.5 height=13.5 aria-hidden=true viewBox="0 0 24 24" class=iconExternalLink_2l9O><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></svg></a></ul></div></div><div class="footer__bottom text--center"><div class=margin-bottom--sm><a href=https://opensource.fb.com/ rel="noopener noreferrer" class=footerLogoLink_tutC><img src=/img/oss_logo.svg alt="Meta Open Source Logo" class="footer__logo themedComponent_siVc themedComponent--light_hHel"><img src=/img/oss_logo.svg alt="Meta Open Source Logo" class="footer__logo themedComponent_siVc themedComponent--dark_yETr"></a></div><div class=footer__copyright>Copyright © 2025 Meta Platforms, Inc.</div></div></div></footer></div>