Skip to content

components/RowActionsMenu

import { … } from 'zidane-ui'ui/src/components/RowActionsMenu.tsx

Popover (click)
HoverCard (hover)
Hover me
RowActionsMenu (3-dots)
Tooltip, inline and portaled

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.

TypeScript
function RowActionsMenu(props: RowActionsMenuProps): Element | null
Parameters
NameTypeDescription
propsRowActionsMenuProps

Component props: open, onClose, items, and either anchorRef or position.

Element | null
RowActionsMenu props
NameTypeDescription
anchorRef?RefObject<HTMLElement | null>

Trigger to anchor against (3-dots path). Ignored when position is set.

className?string

Extra classes on the root element.

itemsreadonly RowActionItem[]

The rows, in order.

onClose() => void

Called on an outside press, or when a row is picked.

openboolean

Whether the menu is shown.

position?{ x: number; y: number } | null

Viewport point for the menu's top-left (right-click path). Wins over anchorRef.

style?CSSProperties

Inline styles on the root element, merged after the component's own.

ui/src/components/RowActionsMenu.tsx:151

Interfaces#

RowActionsMenuPropsInterface#

Props for RowActionsMenu.

TypeScript
interface RowActionsMenuProps
RowActionsMenuProps properties
NameTypeDescription
anchorRef?RefObject<HTMLElement | null>

Trigger to anchor against (3-dots path). Ignored when position is set.

className?string

Extra classes on the root element.

itemsreadonly RowActionItem[]

The rows, in order.

onClose() => void

Called on an outside press, or when a row is picked.

openboolean

Whether the menu is shown.

position?{ x: number; y: number } | null

Viewport point for the menu's top-left (right-click path). Wins over anchorRef.

style?CSSProperties

Inline styles on the root element, merged after the component's own.

ui/src/components/RowActionsMenu.tsx:81

Types#

RowActionItemType#

One entry of a RowActionsMenu: a row that runs an action, or one that opens more rows beside it.

TypeScript
type RowActionItem = RowActionLeaf | RowActionParent

ui/src/components/RowActionsMenu.tsx:78