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 id is provided, the system will use the label. Plugins should ensure there are no label conflicts if they do not wish to provide id. label conflicts (when not using unique ids) can cause multiple items to be hovered at once.

Parameters
Name Type Description
props object

props to pass to the react renderer

Name Type Attributes Default Description
label string

label to show on the menu item

id string <optional>

specific id used for this item

hint string <optional>

hint to show on the right hand side (usually keyboard combo)

subtext string <optional>

description to show underneath

image string <optional>

link to image to show on the side

icon function <optional>

react component to render on the side

render function <optional>

render function for custom rendering the menu item

action module:DiscordContextMenu~MenuItemOnClick <optional>

function to perform on click

onClick module:DiscordContextMenu~MenuItemOnClick <optional>

function to perform on click (alias of action)

onClose function <optional>

function to run when this is closed

danger boolean <optional>
false

should the item show as danger (red)

disabled boolean <optional>
false

should the item be disabled/unclickable

style object <optional>

allows you to add custom styles

closeOnClick boolean <optional>

allows you to prevent closing on click