This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
This is documentation for the next SDK version.
Toolbar
A SwiftUI Toolbar component that places items in the toolbar of the view it wraps.
iOS
tvOS
Included in Expo Go
Expo UI Toolbar matches the official SwiftUI toolbar(content:) API and adds a toolbar to the view it wraps.
Put the toolbar items in Toolbar.Content. Everything else inside Toolbar is the view the toolbar belongs to. Inside a NavigationStack, the items go into the navigation bar.
A ToolbarItem has to be inside Toolbar.Content. If the current platform or OS version does not offer a placement, the item uses automatic.
Close button in a sheet
A sheet has no navigation bar of its own, so give its content a NavigationStack. On iOS 26 and later, a Button with role="close" and no label or children shows as a close (X) icon. On earlier versions, set a label and systemImage="xmark" instead.
ToolbarCloseButtonExample.tsx
import{BottomSheet,Button,Host,NavigationStack,Text,Toolbar,VStack,}from'@expo/ui/swift-ui';import{
navigationTitle,
padding,
presentationDetents,}from'@expo/ui/swift-ui/modifiers';import{ useState }from'react';exportdefaultfunctionToolbarCloseButtonExample(){const[isPresented, setIsPresented]=useState(false);return(<Hoststyle={{ flex:1}}><BottomSheetisPresented={isPresented}onIsPresentedChange={setIsPresented}anchor={<Buttonlabel="Show details"onPress={()=>setIsPresented(true)}/>}><NavigationStackmodifiers={[presentationDetents(['medium'])]}><Toolbarmodifiers={[navigationTitle('Grey Heron')]}><VStackalignment="leading"spacing={12}modifiers={[padding({ all:20})]}><Text>
Stands still at the water's edge for long spells,
then strikes at fish with its dagger bill.
</Text></VStack><Toolbar.Content><Buttonrole="close"onPress={()=>setIsPresented(false)}/></Toolbar.Content></Toolbar></NavigationStack></BottomSheet></Host>);}