This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 54).
Group
A SwiftUI Group component for grouping views without affecting layout.
iOS
tvOS
Expo UI Group matches the official SwiftUI Group API and groups views together without introducing additional layout structure.
Installation
Terminal
- npx expo install @expo/uiIf you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
Basic group
Groups are useful for applying modifiers to multiple views at once or organizing views without affecting layout.
BasicGroupExample.tsx
import { Host, Group, Text } from '@expo/ui/swift-ui'; import { foregroundStyle } from '@expo/ui/swift-ui/modifiers'; export default function BasicGroupExample() { return ( <Host matchContents> <Group modifiers={[foregroundStyle({ color: 'blue' })]}> <Text>First item</Text> <Text>Second item</Text> <Text>Third item</Text> </Group> </Host> ); }
API
Component
Type: React.Element<GroupProps>
Type:
ReactNode