Genesis
@beta

SettingsSubPage

SettingsSubPage — drill-in detail layout. Composes a KeyboardAvoidingView + scroll + dirty-form leave warning + optimistic-save pattern. The save action is surfaced in the nav bar via a `<NavBarSaveButton>` rendered through `headerRight`. Why ship: the recurring shape is "form fields + nav-bar Save + leave guard"; consumers re-implement this every time. Genesis ships the shape so consumers focus on the form fields themselves. Layer-3 customization: pass `headerTitle`, `headerLeft`, OR a direct `headerOptions={...}`. Use `getSettingsSubPageStackOptions()` to get a `<Stack.Screen options={...}>` object (with the save button wired via `headerRight`).

packages/ui-native/src/layouts/settings-sub-page.tsx

Import
Subpath export: @marktiderman/genesis-ui-native
import { SettingsSubPage } from "@marktiderman/genesis-ui-native";
Components
Auto-generated from TypeScript source via react-docgen-typescript.

confirmDiscardChanges

Default leave-guard helper. Pops a native Alert with Discard / Keep Editing buttons; calls `proceed()` only if the user opts to discard. <SettingsSubPage onConfirmLeave={confirmDiscardChanges} ... />

No declared props.

getSettingsSubPageStackOptions

Compose `<Stack.Screen options={...}>` for a SettingsSubPage. Wires the nav-bar Save button via `headerRight` automatically when `onSave` is passed.

PropTypeDefaultDescription
dirtyboolean—
headerLeft(() => ReactNode)—
headerOptionsRecord<string, unknown>—
headerRight(() => ReactNode)—
headerTitlestring—
largeboolean—
onSave(() => void | Promise<void>)—
saveLabelstring—
savingboolean—
scrollEdgeBehaviorenum—

SettingsSubPage

PropTypeDefaultDescription
children*ReactNode—Form / detail body content. Pass any node tree.
classNamestring—Override root container styling.
dirtyboolean—When true, the Save button is enabled and the back-confirm guard fires when the user tries to leave. Mark `true` whenever the form has unsaved changes.
headerLeft(() => ReactNode)—Custom node rendered on the left of the nav bar.
headerLeftItems(() => readonly unknown[])—Native header items on the left (`unstable_headerLeftItems`).
headerOptionsRecord<string, unknown>—Direct passthrough merged INTO the resolved options object. Wins over named props.
headerRight(() => ReactNode)—Custom node rendered on the right of the nav bar.
headerRightItems(() => readonly unknown[])—Native header items on the right (react-native-screens' `unstable_headerRightItems`): bar buttons and menus drawn by UIKit, with iOS 26's glass grouping. Prefer them to `headerRight`.
headerTitlestring—Custom header title. Falls back to `<Stack.Screen name>` mapping.
largeboolean—When true, iOS uses large-title mode + scroll-edge appearance.
onConfirmLeave((proceed: () => void) => void) | null—Confirm-leave hook. Implementations should integrate with the navigator's `beforeRemove` listener (React Navigation) — Genesis provides a default `Alert` confirm helper via `confirmDiscardChanges()`. Pass null to opt OUT of the leave guard.
onSave(() => void | Promise<void>)—Save handler. Required to render a Save button in the nav bar.
saveLabelstring—Save button label. Default `"Save"`.
savingboolean—When true, the Save button shows a busy indicator and is non-pressable.
scrollEdgeBehaviorenum—iOS scroll-edge behavior. `"match"` collapses, `"transparent"` always transparent, `"opaque"` always opaque.
searchScreenSearchOptions—Native search in the header (react-native-screens' `headerSearchBarOptions`): the system search field under the large title, which hides on scroll. On iOS 26 pass `placement: "integrated"` (or `"integratedButton"`) to put it in the toolbar; with a tab bar, search is usually its own tab (`role: "search"` on NativeTabs). Never draw your own.
testIDstringsettings-sub-pagetestID on the root container. Default `"settings-sub-page"`.