- Home
- Interfaces
- DiscordContextMenu~MenuItem
-
MenuItem
-
Description
This is the generic context menu item component. It is very extensible and will adapt it's type depending on the props.
Note: The item ID should be unique to this item across the entire menu. If no
idis provided, the system will use thelabel. Plugins should ensure there are nolabelconflicts if they do not wish to provideid.labelconflicts (when not using uniqueids) can cause multiple items to be hovered at once.Parameters
Name Type Description propsobject props to pass to the react renderer
Name Type Attributes Default Description labelstring label to show on the menu item
idstring <optional> specific id used for this item
hintstring <optional> hint to show on the right hand side (usually keyboard combo)
subtextstring <optional> description to show underneath
imagestring <optional> link to image to show on the side
iconfunction <optional> react component to render on the side
renderfunction <optional> render function for custom rendering the menu item
actionmodule:DiscordContextMenu~MenuItemOnClick <optional> function to perform on click
onClickmodule:DiscordContextMenu~MenuItemOnClick <optional> function to perform on click (alias of
action)onClosefunction <optional> function to run when this is closed
dangerboolean <optional> false should the item show as danger (red)
disabledboolean <optional> false should the item be disabled/unclickable
styleobject <optional> allows you to add custom styles
closeOnClickboolean <optional> allows you to prevent closing on click
Details