ContextMenu#

Github

Context Menu is a menu that appears when the user right-clicks on an element. This menu typically contains options related to the current element or action, allowing the user to perform specific operations.

import { ContextMenu, ContextMenuGroup, ContextMenuRadioGroup, ContextMenuCheckboxGroup, ContextMenuItem, } from "wis/contextMenu"

API Reference#

ContextMenu#

NameTypeDefaultDescription
disabledbooleanfalseWhen true, prevents the user from interacting with the context menu.

ContextMenuGroup#

NameTypeDefaultDescription
titlestringnoneThe group title text will show at the beginning of the group.
onSelect(value: string) => voidnoneEvent handler called when group item click.

ContextMenuRadioGroup#

NameTypeDefaultDescription
namestringnoneThe unique name of group.
titlestringnoneThe group title text will show at the beginning of the group.
valuestringnoneThe value of selected item in the group. Must be used in conjunction with onChecked.
defaultValuestringnoneThe default value of selected item in the group.
onChange(value: string) => voidnoneEvent handler called when group item click.

ContextMenuCheckboxGroup#

NameTypeDefaultDescription
namestringnoneThe unique name of group.
titlestringnoneThe group title text will show at the beginning of the group.
valuestring[]noneThe value of selected item in the group. Must be used in conjunction with onChange.
defaultValuestring[]noneThe default value of selected item in the group.
onChange(value: string[]) => voidnoneEvent handler called when group item click.

ContextMenuItem#

NameTypeDefaultDescription
labelstringnoneThe text information displayed on the item.
valuestringnoneThe unique value of the item.
statusdangernoneSets the special status of the item.
disabledbooleanfalseWhen true, prevents the user from interacting with the context menu item.
iconReactNodenoneThe icon element will be displayed next to the context menu item text.
shortcutKeystringnoneSets a global shortcut key, such as Control+I. When the user presses the combination key, the context menu item's click event will be triggered. View Keyboard
onClick(event: Event) => voidnoneEvent handler called when the user select an item (via mouse or keyboard).