Genesis
@stable

toMenuAction

A row action as the system menu takes it: its SF Symbol, and destructive in red.

packages/ui-native/src/components/use-row-actions.tsx

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

toMenuAction

A row action as the system menu takes it: its SF Symbol, and destructive in red.

PropTypeDefaultDescription
id*string—
label*string—
onPress*() => void—
accentenum—A system color by name, over `tone` (see {@link RowActionAccent}).
confirmsboolean—Its `onPress` asks first or can be undone, so a full swipe that runs it by mistake loses nothing.
destructiveboolean—Destructive (delete, leave): `danger` unless a `tone` or `accent` says otherwise.
iconstring—A Genesis icon name (`trash`, `pin`, `mail-open`), shown behind the swipe and in the menu. A string here, because core is platform-neutral and each platform keeps its own icon set: genesis-ui-native's `NativeIconName` and `isNativeIconName` check it on the phone (an unknown name draws no icon, with a development warning).
reasonstring—Set when a guard refuses it: pressing it explains instead of acting, and screen readers hear why.
sideenum—@deprecated Use `swipe: { side }`. Read when `swipe` is unset.
swipefalse | RowActionSwipe—Where it sits behind the swipe on the phone: `{ side, full? }`, or `false` to keep it in the long-press menu and the screen reader's actions only (an action that needs a second look). Unset: the trailing side, no full swipe (NativeResourceView keeps a view action that didn't say to its menu).
toneenum—What it means; its color comes from that. Default `danger` when destructive, else `tint`.

NativeSystemMenuRow

A row inside the system context menu (`GenesisModules.menu`). The menu's host sizes itself to its content, which would shrink a row that only stretches: so the row is given its measured width once it's known.

PropTypeDefaultDescription
actions*readonly RowSwipeAction[]—
Menu*GenesisMenuComponent—
testID*string—
titlestring—