Skip to main content
‹ Back and gestures
Options

Options

The options of back and gestures.

SectionBack and gesturesDraftDocumented, not reviewed yet: the API can change.

Options​

Every key, with the platforms it works on. A dashed platform means the key does nothing there.

20 options shown

topBar.backButtonOptionsTopBarBackButton

The back button of the screen.

accessibilityLabelstring= 'Navigate Up'

The description of the button for screen readers.

iOS (not supported)iPadOS (not supported)Android
idstring= 'ApexNavigation.back'

The id sent as buttonId of the press that the back button, the swipe back and the history menu send instead of leaving when the screen holds the user back (usePreventLeave).

iOSiPadOSAndroid
iconImageResource

The arrow: an image, or an icon for each platform. On iOS it is the back indicator image of the bar, tinted when color is set; an SF Symbol is used as a symbol; with iconBackground or enableMenu: false it is the icon of an own button. On Android it replaces the arrow of the navigation button and is tinted with color (the theme's color without it); with iconBackground it sits on the shape.

Type: PlatformIcon ›
iOSiPadOSAndroidShowcase 3.2 ›
visibleboolean= true

Whether the back button shows. On iOS it hides the button of the navigation item, and the bar counts it as hidden when deciding whether an inline large title fits. On Android false removes the arrow and true on the first screen shows one. It only hides the button; holding the user back is usePreventLeave.

iOSiPadOSAndroidShowcase 3.3 ›
titlestring

The text of the back button. With the glass design (iOS 26+, see UIDesignRequiresCompatibility) the system button without it is an arrow alone, since the title of the screen below is never shown; without it, it is that title while it fits. It is set on the screen below, as its back button title.

iOSiPadOSAndroid (not supported)Showcase 3.1 ›
showTitleboolean

true shows the title of the screen below (or title), false shows an arrow alone (the minimal mode). Without it the system decides; with the glass design that is the arrow.

iOSiPadOSAndroid (not supported)Showcase 3.1 ›
colorColor

The color of the arrow and of the text. Without it the system color on iOS and the theme's on-surface color on Android.

iOSiPadOSAndroidShowcase 3.2 ›
fontSizenumber

The size of the font of the text. The font is built when any font option is set, the size defaulting to 17. The system rebuilds the button to show a new font, so the library flips its mode back and forth, not during a transition. Android has no text on the arrow.

iOSiPadOSAndroid (not supported)
fontFamilyFontFamily

The font family of the text, handled like fontSize.

iOSiPadOSAndroid (not supported)
fontStyleFontStyle

The slant of the font of the text, handled like fontSize.

iOSiPadOSAndroid (not supported)
fontWeightFontWeight

The weight of the font of the text, handled like fontSize.

iOSiPadOSAndroid (not supported)
iconBackgroundIconBackgroundOptions

A shape behind the icon, as for a button. It takes effect with a color of the shape. On iOS the icon (the chevron by default) is drawn on it and the back button becomes an own button that keeps the history menu unless enableMenu is false; without a capsule with the glass design by default. On Android the arrow sits on the shape.

Type: IconBackgroundOptions ›
iOSiPadOSAndroidShowcase 3.2 ›
testIDstring

The identifier tests find the button by: the view tag and the resource id. Without it, BackButton. On iOS it can't be set: UIKit names the system back button BackButton itself, and the library leaves that identifier alone; it applies there to an own back button only (enableMenu: false or iconBackground).

iOS (not supported)iPadOS (not supported)Android
enableMenuboolean= true

Whether a long press opens the history menu. false makes the screen use an own button without the menu.

iOSiPadOSAndroid (not supported)Showcase 3.3 ›
displayMode'default' | 'generic' | 'minimal'

How the system button shortens its text when the bar is full: 'default' uses the title, then "Back", then the arrow; 'generic' "Back", then the arrow; 'minimal' the arrow alone. showTitle: false means 'minimal'. Color, font and menu stay.

iOSiPadOSAndroid (not supported)Showcase 3.1 ›

(iOS 26+, glass design) Whether the Liquid Glass capsule under the back button is hidden. It works only for an own button with an iconBackground, where the shape is already drawn into the icon; the system button ignores it.

iOSiPadOSAndroidShowcase 3.2 ›
popStackOnPressboolean= true

Whether the back button, the swipe back and the history menu take the screen off the stack. With false they send a button press with the back button's id instead. Set by usePreventLeave; apps don't set it.

iOSiPadOSAndroid
popGestureboolean | 'edge'= true

The swipe back in the stack: true from the edge and, on iOS 26, from anywhere in the content; 'edge' only from the edge, so horizontal gestures of the content (sliders, carousels) keep theirs; false no swipe, the back button still works. The top screen's value applies each time it shows, and at once through mergeOptions. Before iOS 26 'edge' is the same as true. Android has the system back instead and doesn't read it.

iOSiPadOSAndroid (not supported)Showcase 3.5 ›
hardwareBackButtonHardwareBackButtonOptions

What the system back button and the back gesture do on the screen.

iOS (not supported)iPadOS (not supported)AndroidShowcase 3.6 ›
Generated from the types and their comments. Edit the source ↗