Skip to main content

Action Menu

v.5.0.0

Installation

yarn add @mercell/action-menu-react

Usage

Using the Action Menu component is as simple as importing it like this. Which icons to use might change depending on your use.

import { ActionMenu } from '@mercell/action-menu-react';
import { Download32, TrashCan32 } from '@carbon/icons-react';
Live Editor
Result

Types, definitions, etc.

ActionMenuProps
interface ActionMenuProps {
actions: Action[];
label?: string;
id: string;
} & JSX.IntrinsicElements['ul']
NameTypeDefaultRequiredDescription
actionsArray-yesArray of Action
labelstringnoLabel
idstringyesId for the Action Menu
Action
interface Action {
label: string;
handler: () => void;
Icon: CarbonIconType;
className?: string;
}
NameTypeDefaultRequiredDescription
labelstring-yesLabel for the button
handlerfunction-yesFunction for the buttons onClick
IconCarbonIconType-yesIcon for the button
classNamestringnoAdditional classes