@hautechai/webui.contextmenu
v2.1.27
Published
Right-click or interaction-triggered menu component with contextual actions and flexible presentation options.
Readme
ContextMenu
Purpose
Right-click or interaction-triggered menu component with contextual actions and flexible presentation options.
Installation
# pnpm (recommended)
pnpm add @hautechai/webui.contextmenu
# npm
npm install @hautechai/webui.contextmenu
# yarn
yarn add @hautechai/webui.contextmenuParameters
| Parameter | Type | Description | | ----------- | ----------------------- | ------------------------------------------------------------------------------------ | | heading | object | Optional heading configuration with data and optional badge string | | menus | ReactNode[] | Optional array of menu content elements | | children | React.ReactNode | Required trigger element that activates the context menu | | variation | 'menu' | 'bottomSheet' | Optional presentation style - popup menu or mobile bottom sheet (defaults to 'menu') | | isLeftClick | boolean | When true, activates on left click instead of right click |
Usage Example
<ContextMenu
heading={{ data: 'Actions', badge: '3' }}
menus={[<MenuSection1 />, <MenuSection2 />]}
variation="menu"
isLeftClick={false}
>
<ContentElement />
</ContextMenu>