|
| 1 | +# `react-native-app-helpers/Row` |
| 2 | + |
| 3 | +A React component which fills the container horizontally and applies a flex row |
| 4 | +to its children. |
| 5 | + |
| 6 | +## Usage |
| 7 | + |
| 8 | +```tsx |
| 9 | +import { Row } from "react-native-app-helpers"; |
| 10 | + |
| 11 | +const ExampleScreen = () => ( |
| 12 | + <Row |
| 13 | + height="fitsContent" |
| 14 | + horizontalDistribution="left" |
| 15 | + verticalAlignment="top" |
| 16 | + > |
| 17 | + <Text>These example items are aligned to the top left.</Text> |
| 18 | + <Text> |
| 19 | + The container is as short as possible while containing their height. |
| 20 | + </Text> |
| 21 | + </Row> |
| 22 | +); |
| 23 | +``` |
| 24 | + |
| 25 | +```tsx |
| 26 | +import { Row } from "react-native-app-helpers"; |
| 27 | + |
| 28 | +const ExampleScreen = () => ( |
| 29 | + <Row |
| 30 | + height="fillsContainer" |
| 31 | + horizontalDistribution="centered" |
| 32 | + verticalAlignment="centered" |
| 33 | + > |
| 34 | + <Text>These example items are grouped in the center.</Text> |
| 35 | + <Text>The container fills its container vertically.</Text> |
| 36 | + </Row> |
| 37 | +); |
| 38 | +``` |
| 39 | + |
| 40 | +```tsx |
| 41 | +import { Row } from "react-native-app-helpers"; |
| 42 | + |
| 43 | +const ExampleScreen = () => ( |
| 44 | + <Row |
| 45 | + height="fitsContent" |
| 46 | + horizontalDistribution="right" |
| 47 | + verticalAlignment="bottom" |
| 48 | + > |
| 49 | + <Text>These example items are aligned to the bottom right.</Text> |
| 50 | + <Text> |
| 51 | + The container is as short as possible while containing their height. |
| 52 | + </Text> |
| 53 | + </Row> |
| 54 | +); |
| 55 | +``` |
| 56 | + |
| 57 | +```tsx |
| 58 | +import { Row } from "react-native-app-helpers"; |
| 59 | + |
| 60 | +const ExampleScreen = () => ( |
| 61 | + <Row |
| 62 | + height="fitsContent" |
| 63 | + horizontalDistribution="spaced" |
| 64 | + verticalAlignment="stretched" |
| 65 | + > |
| 66 | + <Text> |
| 67 | + These example items are spaced out horizontally, and are stretched to fill |
| 68 | + the container vertically. |
| 69 | + </Text> |
| 70 | + <Text> |
| 71 | + The container is as short as possible while containing their height. |
| 72 | + </Text> |
| 73 | + </Row> |
| 74 | +); |
| 75 | +``` |
| 76 | + |
| 77 | +```tsx |
| 78 | +import { Row } from "react-native-app-helpers"; |
| 79 | + |
| 80 | +const ExampleScreen = () => ( |
| 81 | + <Row |
| 82 | + height="fitsContent" |
| 83 | + horizontalDistribution="spacedTouchingEnds" |
| 84 | + verticalAlignment="stretched" |
| 85 | + > |
| 86 | + <Text> |
| 87 | + These example items are spaced out horizontally to the very edges of the |
| 88 | + container, and are stretched to fill the container vertically. |
| 89 | + </Text> |
| 90 | + <Text> |
| 91 | + The container is as short as possible while containing their height. |
| 92 | + </Text> |
| 93 | + </Row> |
| 94 | +); |
| 95 | +``` |
0 commit comments