Skip to content

docs: Native Stack - headerBackButtonMenuEnabled #1352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions versioned_docs/version-7.x/native-stack-navigator.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ Requires `react-native-screens` version >=3.3.0.

Only supported on iOS.

<img src="/assets/7.x/native-stack/headerBackButtonMenuEnabled.png" width="500" alt="Header back button menu enabled" />

#### `headerBackVisible`

Whether the back button is visible in the header. You can use it to show a back button alongside `headerLeft` if you have specified it.
Expand All @@ -178,6 +180,8 @@ Title string used by the back button on iOS. Defaults to the previous scene's ti

Only supported on iOS.

<img src="/assets/7.x/native-stack/headerBackTitle.jpeg" width="500" alt="Header back title" />

#### `headerBackTitleVisible`

Whether the back button title should be visible or not.
Expand All @@ -193,6 +197,31 @@ Style object for header back title. Supported properties:

Only supported on iOS.

<img src="/assets/7.x/native-stack/headerBackTitleStyle.png" width="500" alt="Header back title style" />

Example:

```js
export function NativeStack() {
return (
<Stack.Navigator>
<Stack.Screen
name="NewsFeed"
component={NewsFeedScreen}
options={{
title: 'Feed',
headerBackTitle: 'Back title example',
headerBackTitleStyle: {
fontSize: 14,
fontFamily: 'Georgia',
},
}}
/>
</Stack.Navigator>
);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to put a full example here you'd also have to add Static API (your example is in Dynamic API) see https://reactnavigation.org/docs/7.x/native-stack-navigator#usage for reference

Here. maybe a simpler example would also work just fine?

Suggested change
export function NativeStack() {
return (
<Stack.Navigator>
<Stack.Screen
name="NewsFeed"
component={NewsFeedScreen}
options={{
title: 'Feed',
headerBackTitle: 'Back title example',
headerBackTitleStyle: {
fontSize: 14,
fontFamily: 'Georgia',
},
}}
/>
</Stack.Navigator>
);
}
headerBackTitleStyle: {
fontSize: 14,
fontFamily: 'Georgia',
},

```

#### `headerBackImageSource`

Image to display in the header as the icon in the back button. Defaults to back icon image for the platform
Expand Down
Loading