This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Reference Expo UI SwiftUI Divider A SwiftUI Divider component for creating visual separators.
Recommended version:
~58.1.0
Expo UI Divider matches the official SwiftUI Divider API and creates a visual separator between content.
Installation
- npx expo install @expo/ui
- yarn expo install @expo/ui
- pnpm expo install @expo/ui
- bun expo install @expo/ui
If you are installing this in an existing React Native app , make sure to install expo in your project.
Usage
Basic divider
import { Host , Divider , VStack , Text } from '@expo/ui/swift-ui' ;
export default function BasicDividerExample ( ) {
return (
< Host style = { { flex: 1 } } >
< VStack >
< Text > First section </ Text >
< Divider />
< Text > Second section </ Text >
</ VStack >
</ Host >
) ;
}
Divider in a list
import { Host , Divider , VStack , Text } from '@expo/ui/swift-ui' ;
export default function DividerInListExample ( ) {
return (
< Host style = { { flex: 1 } } >
< VStack spacing = { 8 } >
< Text > Item 1 </ Text >
< Divider />
< Text > Item 2 </ Text >
< Divider />
< Text > Item 3 </ Text >
< Divider />
< Text > Item 4 </ Text >
</ VStack >
</ Host >
) ;
}
Dividers are commonly used to separate groups of actions in context menus.
DividerInContextMenuExample.tsx import {
Host ,
ContextMenu ,
Button ,
Text ,
Divider ,
} from '@expo/ui/swift-ui' ;
export default function DividerInContextMenuExample ( ) {
return (
< Host style = { { flex: 1 } } >
< ContextMenu >
< ContextMenu.Items >
< Button
label = " Edit"
onPress = { ( ) => console . log ( 'Edit' ) }
/>
< Button
label = " Duplicate"
onPress = { ( ) => console . log ( 'Duplicate' ) }
/>
< Divider />
< Button
label = " Delete"
role = " destructive"
onPress = { ( ) => console . log ( 'Delete' ) }
/>
</ ContextMenu.Items >
< ContextMenu.Trigger >
< Text > Long press me </ Text >
</ ContextMenu.Trigger >
</ ContextMenu >
</ Host >
) ;
}
API
import { Divider } from '@expo/ui/swift-ui' ;
Component Type: React.Element < DividerProps >
Divider component uses the native Divider component.
A visual element that can be used to separate other content.