Genesis
@stable

NativeRecordPeek

packages/ui-native/src/data/NativeRecordPeek.tsx

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

NativeRecordPeek

PropTypeDefaultDescription
onClose*() => void—
open*boolean—
row*Row | null—The record, or null while none is open.
view*AnyRecordView<T>—
canNativeResourceScreenCan<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.
confirmDeletebooleantrue`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.
headerReactNode—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`).
listsPartial<Record<string, Partial<Omit<NativeResourceViewProps<Row>, "view" | "filter">>>>—More props for a list section's NativeResourceView, by section id.
messagesPartial<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.
sectionstring—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.
slotsPartial<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%"]`.
switcherReactNode—Above the sections: a switcher between records.
testIDstringrecord-peek