VStack
A view that arranges its children vertically.
Example​
- swiftui-react-native
- SwiftUI
- React Native
<VStack alignment="leading" spacing={10}>
<Text>Hello</Text>
<Text>World</Text>
</VStack>
VStack(alignment: .leading, spacing: 10) {
Text("Hello")
Text("World")
}
<View style={{ gap: 10 }}>
<Text>Hello</Text>
<Text>World</Text>
</View>
Props​
VStack inherits all View Modifiers as props.
prop | description | type | required | default |
---|---|---|---|---|
spacing | Amount of space between stack items | number | no | 0 |
alignment | The alignment guide | 'leading' | 'trailing' | 'center' | no | 'center' |
children | Stack items | ReactNode | no | null |