components/RowActionsMenu
import { … } from 'zidane-ui'ui/src/components/RowActionsMenu.tsx
Components#
RowActionsMenuComponent#
Mounted from its first open on (then kept, for the exit and the next open): every sidebar row and transcript turn carries one, and a closed menu's surface, presence and dismiss listeners per row were most of what mounting a list of rows cost.
function RowActionsMenu(props: RowActionsMenuProps): Element | nullParameters
| Name | Type | Description |
|---|---|---|
| props | RowActionsMenuProps | Component props: |
Returns
Element | nullProps
| Name | Type | Description |
|---|---|---|
| anchorRef? | RefObject<HTMLElement | null> | Trigger to anchor against (3-dots path). Ignored when |
| className? | string | Extra classes on the root element. |
| items | readonly RowActionItem[] | The rows, in order. |
| onClose | () => void | Called on an outside press, or when a row is picked. |
| open | boolean | Whether the menu is shown. |
| position? | { x: number; y: number } | null | Viewport point for the menu's top-left (right-click path). Wins over |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
Interfaces#
RowActionsMenuPropsInterface#
Props for RowActionsMenu.
interface RowActionsMenuPropsProperties
| Name | Type | Description |
|---|---|---|
| anchorRef? | RefObject<HTMLElement | null> | Trigger to anchor against (3-dots path). Ignored when |
| className? | string | Extra classes on the root element. |
| items | readonly RowActionItem[] | The rows, in order. |
| onClose | () => void | Called on an outside press, or when a row is picked. |
| open | boolean | Whether the menu is shown. |
| position? | { x: number; y: number } | null | Viewport point for the menu's top-left (right-click path). Wins over |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
Types#
RowActionItemType#
One entry of a RowActionsMenu: a row that runs an action, or one that opens more rows beside it.
type RowActionItem = RowActionLeaf | RowActionParent