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-nativeimport { 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| id* | string | — | |
| label* | string | — | |
| onPress* | () => void | — | |
| accent | enum | — | A system color by name, over `tone` (see {@link RowActionAccent}). |
| confirms | boolean | — | Its `onPress` asks first or can be undone, so a full swipe that runs it by mistake loses nothing. |
| destructive | boolean | — | Destructive (delete, leave): `danger` unless a `tone` or `accent` says otherwise. |
| icon | string | — | 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). |
| reason | string | — | Set when a guard refuses it: pressing it explains instead of acting, and screen readers hear why. |
| side | enum | — | @deprecated Use `swipe: { side }`. Read when `swipe` is unset. |
| swipe | false | 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). |
| tone | enum | — | 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| actions* | readonly RowSwipeAction[] | — | |
| Menu* | GenesisMenuComponent | — | |
| testID* | string | — | |
| title | string | — |