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.
You will normally use a combination of flexDirection, alignItems, and justifyContent to achieve the right layout.
flex will define how your items are going to “fill” over the available space along your main axis. Space will be divided according to each element's flex property.
In the following example, the red, yellow, and green views are all children in the container view that has flex: 1 set. The red view uses flex: 1 , the yellow view uses flex: 2, and the green view uses flex: 3 . 1+2+3 = 6, which means that the red view will get 1/6 of the space, the yellow 2/6 of the space, and the green 3/6 of the space.
Flex Direction
flexDirection 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.
column (default value) : 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.
row: 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.
column-reverse : 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.
row-reverse : 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.
https://reactnative.dev/docs/flexbox
JOIN OUR TELEGRAM COMMUNITY FOR FREE REACT NATIVE TRAINING
https://t.me/jasacadamy
#react-native #flex #Layout #reactnative #design
#tags
learn react,learn react.js,react,make apps with react,free react course,create react app,react.js,flex,css flexbox explained,react vs react native,full stack,css flexbox tutorial,css flexbox axis explained,learn css flexbox in 20 minutes,learn css flexbox in 15 minutes,software industry,learn css flexbox fast,react native,flexbox,css flexbox for dummies,react flexbox,react tutorial,react hands on,easy css flexbox tutorial,beginners,css flex direction,flex direction row,flex-direction row,flex direction vertical,flex-direction initial,flex direction column vs row,flex order elements,flex-direction row vs column,flexbox order elements,flexbox rows and columns,flexbox order property,flex flow,css flex order elements,flex row reverse,flex row column reverse,order css flex,css flexbox,flexbox tutorial,flex,flexbox,css order property,justify-content,css grid,flexbox react native,flexbox tutorial react native,react native,react vs react native,flexbox tutorial react,react native flex,react native flexbox,react native tutorial,flexbox tutorial,react native flex layout,react native flexbox grid,react native flex tutorial,react native for beginners,react native flexbox layout,flexbox tutorial hitesh,flexbox,react native flexbox tutorial,react native flexbox explained,react flexbox tutorial,react flexbox grid,react vs react native,react native,react native cli,react native flex,react native course,react native flexbox,react native by mosh,react native tutorial,react native tutorials,react native build apk,react native apk build,react native crash course,react native for beginners,react native app development,react native complete course,react native backend tutorial,react native tutorial for beginners,react flexbox,react tutorial,react,native flexbox,flexbox,react vs react native,group button react native,react native,react native app,react native flex,react native flexbox,react native project,react native tutorial,react native ui design,react native buttongroup,react native for beginners,react native custom group button,react native tutorial for beginners,react flexbox,react tutorial,react,native flexbox,tutorial,beginners,flex,flexbox react native,flexbox tutorial react native,react vs react native,flexbox tutorial react,react native,react native flex,tutorial on flexbox,react native flexbox,react native tutorial,react native flex layout,react native flexbox grid,react native flex tutorial,react native for beginners,react native flexbox layout,flexbox tutorial,flexbox tutorial hitesh,react native flexbox tutorial,react native flexbox explained