diff --git a/packages/native-stack/src/types.tsx b/packages/native-stack/src/types.tsx --- a/packages/native-stack/src/types.tsx +++ b/packages/native-stack/src/types.tsx @@ -1010,6 +1010,14 @@ */ hidesSharedBackground?: boolean | undefined; /** + * Supported bar axes and preferred placement, matching UIBarButtonItem.axisBehavior. + * Only supported by the new native stack on iOS 27.1 and later, + * when react-native-screens is built with the iOS 27.1 SDK or newer. + * Defaults to automatic; removing the option restores automatic. + * Ignored on other platforms and older iOS versions. + */ + axisBehavior?: 'automatic' | 'horizontalOnly' | 'verticalPreferred' | undefined; + /** * Whether this item can share a background with other items. * Only available from iOS 26.0 and later. * @@ -1315,6 +1323,14 @@ * Read more: https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground */ hidesSharedBackground?: boolean | undefined; + /** + * Supported bar axes and preferred placement, matching UIBarButtonItem.axisBehavior. + * Only supported by the new native stack on iOS 27.1 and later, + * when react-native-screens is built with the iOS 27.1 SDK or newer. + * Defaults to automatic; removing the option restores automatic. + * Ignored on other platforms and older iOS versions. + */ + axisBehavior?: 'automatic' | 'horizontalOnly' | 'verticalPreferred' | undefined; }; /** diff --git a/packages/native-stack/src/next/views/useHeaderConfig.ios.tsx b/packages/native-stack/src/next/views/useHeaderConfig.ios.tsx --- a/packages/native-stack/src/next/views/useHeaderConfig.ios.tsx +++ b/packages/native-stack/src/next/views/useHeaderConfig.ios.tsx @@ -129,6 +129,7 @@ type: 'item', title: item.label, icon: getIOSHeaderIcon(item.icon), + axisBehavior: item.axisBehavior, onPress: item.onPress, }; } @@ -141,6 +142,7 @@ type: 'item', title: item.label, icon: getIOSHeaderIcon(item.icon), + axisBehavior: item.axisBehavior, menu: { ...getIOSHeaderMenu(item.menu, `${id}-menu`), title: item.menu.title, @@ -161,6 +163,7 @@ id: fallbackId, type: 'item', render: () => item.element, + axisBehavior: item.axisBehavior, }; }); }