NativeRecordView
One record's screen, from its record view (defineRecordView): ```tsx <Stack.Screen options={getNativeRecordViewStackOptions({ view: brandRecordView, row: brand })} /> <NativeRecordView view={brandRecordView} row={brand} /> ```
packages/ui-native/src/data/resource-view/NativeRecordView.tsx
@marktiderman/genesis-ui-native/dataimport { NativeRecordView } from "@marktiderman/genesis-ui-native/data";react-docgen-typescript.NativeRecordViewMenu
The header menu: a button that lists the record view's actions. On iOS an action sheet (ActionSheetIOS, destructive ones in red); elsewhere a sheet of rows, since Android's alert shows at most three buttons. A refused action stays listed and explains why when pressed.
| Prop | Type | Default | Description |
|---|---|---|---|
| row* | Row | — | |
| view* | AnyRecordView<T> | — | |
| can | ((action: string, row: T) => false | Allowed) | — | The screen's own rule: `false` hides an action, a sentence refuses it. Only narrows. |
| messages | Partial<NativeRecordViewMessages> | — | |
| onAction | ((name: string, row: T) => unknown) | — | Runs an allowed (and confirmed) action. Default: the provider's `runAction`. |
| testID | string | — |
getNativeRecordViewStackOptions
`<Stack.Screen options>` for a record view: the record's title in the navigation bar and the actions in the header menu. ```tsx <Stack.Screen options={getNativeRecordViewStackOptions({ view: brandRecordView, row: brand })} /> ```
| Prop | Type | Default | Description |
|---|---|---|---|
| row* | Row | — | |
| view* | AnyRecordView<T> | — | |
| can | ((action: string, row: T) => false | Allowed) | — | The screen's own rule: `false` hides an action, a sentence refuses it. Only narrows. |
| headerLeft | (() => ReactNode) | — | Custom node rendered on the left of the nav bar. |
| headerLeftItems | (() => readonly unknown[]) | — | Native header items on the left (`unstable_headerLeftItems`). |
| headerOptions | Record<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`. |
| large | boolean | — | When true, iOS uses large-title mode + scroll-edge appearance. |
| messages | Partial<NativeRecordViewMessages> | — | |
| onAction | ((name: string, row: T) => unknown) | — | Runs an allowed (and confirmed) action. Default: the provider's `runAction`. |
| scrollEdgeBehavior | enum | — | iOS scroll-edge behavior. `"match"` collapses, `"transparent"` always transparent, `"opaque"` always opaque. |
| search | ScreenSearchOptions | — | 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. |
NativeRecordView
One record's screen, from its record view (defineRecordView): ```tsx <Stack.Screen options={getNativeRecordViewStackOptions({ view: brandRecordView, row: brand })} /> <NativeRecordView view={brandRecordView} row={brand} /> ```
| Prop | Type | Default | Description |
|---|---|---|---|
| row* | Row | — | The record, as the screen loaded it. A save refreshes it through the cache. |
| view* | AnyRecordView<T> | — | |
| lists | Partial<Record<string, Partial<Omit<NativeResourceViewProps<Row>, "view" | "filter">>>> | — | More props for a list section's NativeResourceView, by section id. |
| messages | Partial<NativeRecordViewMessages> | — | |
| onOpenSection | ((id: string) => void) | — | With more than four sections: push that section's route (the pushed screen passes `section`). Without it, the section opens in place with an "All sections" row to go back. |
| onSaved | ((row: T) => void) | — | After a settings section saved, with the stored row. |
| onSectionChange | ((id: string) => void) | — | The segmented control changed section. |
| section | string | — | The section to show. With up to four sections, the segmented control's value (default the first). With more, the pushed section; without it, the list of sections. |
| slots | Partial<Record<string, ReactNode | ((top: ReactNode) => ReactNode)>> | — | The screen's own sections, by id. A node is laid out in the screen's scroll view. A section that scrolls itself (a long FlatList) passes a function instead: it gets the screen's top (switcher, readiness, sections) to render as its list's header, and owns the scroll view, so set `contentInsetAdjustmentBehavior="automatic"` on it. |
| switcher | ReactNode | — | Above the sections: a switcher between records. |
| testID | string | — |
NativeResourceWorkspace
| Prop | Type | Default | Description |
|---|---|---|---|
| row* | Row | — | The record, as the screen loaded it. A save refreshes it through the cache. |
| workspace* | AnyRecordView<T> | — | |
| lists | Partial<Record<string, Partial<Omit<NativeResourceViewProps<Row>, "view" | "filter">>>> | — | More props for a list section's NativeResourceView, by section id. |
| messages | Partial<NativeRecordViewMessages> | — | |
| onOpenSection | ((id: string) => void) | — | With more than four sections: push that section's route (the pushed screen passes `section`). Without it, the section opens in place with an "All sections" row to go back. |
| onSaved | ((row: T) => void) | — | After a settings section saved, with the stored row. |
| onSectionChange | ((id: string) => void) | — | The segmented control changed section. |
| section | string | — | The section to show. With up to four sections, the segmented control's value (default the first). With more, the pushed section; without it, the list of sections. |
| slots | Partial<Record<string, ReactNode | ((top: ReactNode) => ReactNode)>> | — | The screen's own sections, by id. A node is laid out in the screen's scroll view. A section that scrolls itself (a long FlatList) passes a function instead: it gets the screen's top (switcher, readiness, sections) to render as its list's header, and owns the scroll view, so set `contentInsetAdjustmentBehavior="automatic"` on it. |
| switcher | ReactNode | — | Above the sections: a switcher between records. |
| testID | string | — |
NativeResourceWorkspaceMenu
| Prop | Type | Default | Description |
|---|---|---|---|
| row* | Row | — | |
| workspace* | AnyRecordView<T> | — | |
| can | ((action: string, row: T) => false | Allowed) | — | The screen's own rule: `false` hides an action, a sentence refuses it. Only narrows. |
| messages | Partial<NativeRecordViewMessages> | — | |
| onAction | ((name: string, row: T) => unknown) | — | Runs an allowed (and confirmed) action. Default: the provider's `runAction`. |
| testID | string | — |
getNativeResourceWorkspaceStackOptions
| Prop | Type | Default | Description |
|---|---|---|---|
| row* | Row | — | |
| workspace* | AnyRecordView<T> | — | |
| can | ((action: string, row: T) => false | Allowed) | — | The screen's own rule: `false` hides an action, a sentence refuses it. Only narrows. |
| headerLeft | (() => ReactNode) | — | Custom node rendered on the left of the nav bar. |
| headerLeftItems | (() => readonly unknown[]) | — | Native header items on the left (`unstable_headerLeftItems`). |
| headerOptions | Record<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`. |
| large | boolean | — | When true, iOS uses large-title mode + scroll-edge appearance. |
| messages | Partial<NativeRecordViewMessages> | — | |
| onAction | ((name: string, row: T) => unknown) | — | Runs an allowed (and confirmed) action. Default: the provider's `runAction`. |
| scrollEdgeBehavior | enum | — | iOS scroll-edge behavior. `"match"` collapses, `"transparent"` always transparent, `"opaque"` always opaque. |
| search | ScreenSearchOptions | — | 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. |
parseSettingNumber
A number as typed: "1.5" or, with a comma as the decimal mark, "1,5". Anything else (an empty string aside) is an error, never NaN.
No declared props.
SEGMENTED_SECTIONS_MAX
Up to this many sections show as a segmented control; more are pushed rows.
No declared props.