Layout
Pass a layout object to any supported component. Numeric lengths use the native layout engine's logical units. Vue bindings use camelCase keys.
| Field | Values | Effect |
|---|---|---|
width, height | number | Set an explicit size. Removing a value restores automatic sizing. |
padding | number | Apply the same inset on every edge. |
gap | number | Set spacing between children on both axes. |
flexGrow | number | Share remaining space with siblings according to their grow factors. |
justifyContent | 'flex-start'| 'center'| 'flex-end' | Position children along the main axis. |
Center a column
vue
<View :layout="{ flexGrow: 1, justifyContent: 'center', padding: 28, gap: 16 }">
<Text :fontSize="30">Your profile</Text>
<TextInput v-model="name" :layout="{ height: 48 }" />
</View>A layout object can be reactive. Updating a supported field repatches the existing view. Deleting the field restores its default. For example, deleting width lets the engine measure the element again.