NativeRecordPeek
packages/ui-native/src/data/NativeRecordPeek.tsx
Import
Subpath export:
@marktiderman/genesis-ui-native/dataimport { NativeRecordPeek } from "@marktiderman/genesis-ui-native/data";Components
Auto-generated from TypeScript source via
react-docgen-typescript.NativeRecordPeek
| Prop | Type | Default | Description |
|---|---|---|---|
| onClose* | () => void | — | |
| open* | boolean | — | |
| row* | Row | null | — | The record, or null while none is open. |
| view* | AnyRecordView<T> | — | |
| can | NativeResourceScreenCan<T> | — | The screen's own rule, as NativeResourceView's `can`: `false` hides Edit or Delete, a sentence refuses it. Only narrows the view's guards. |
| confirmDelete | boolean | true | `false` when `onDelete` confirms on its own (a list's own delete handler): the peek calls it at once instead of asking first. Default `true`, as genesis-ui's RecordPeek, so one `onDelete` means the same on both. |
| header | ReactNode | — | Above the record (a link to its full page). |
| labels | { edit?: string; delete?: string; deleteTitle?: string | undefined; deleteBody?: string | undefined; cancel?: string | undefined; } | undefined | {} | Overrides for the resource-view messages (`common.edit`, `delete` / `bin`, `common.cancel`). |
| lists | Partial<Record<string, Partial<Omit<NativeResourceViewProps<Row>, "view" | "filter">>>> | — | More props for a list section's NativeResourceView, by section id. |
| messages | Partial<NativeRecordViewMessages> | — | |
| onDelete | ((row: T) => unknown) | — | Shows Delete (where `can` and the view's delete guard allow it). The peek confirms first, so pass the write itself (the provider's delete), never a handler that confirms again. Return its promise: the sheet closes when it resolves, and a rejection is shown in plain words. |
| onEdit | ((row: T) => void) | — | Shows Edit (where the screen's `can` and the view's update guard allow it): open the record's form. |
| 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. |
| snapPoints | (string | number)[] | ["60%", "92%"] | The sheet's heights. Default `["60%", "92%"]`. |
| switcher | ReactNode | — | Above the sections: a switcher between records. |
| testID | string | record-peek |