Skip to content

Layout ​

Pass a layout object to any supported component. Numeric lengths use the native layout engine's logical units. Vue bindings use camelCase keys.

FieldValuesEffect
width, heightnumberSet an explicit size. Removing a value restores automatic sizing.
paddingnumberApply the same inset on every edge.
gapnumberSet spacing between children on both axes.
flexGrownumberShare 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.

Component reference

NitroUI Vue · Independent community renderer