1.6.0 • Published 9 months ago
@igloo-ui/action-menu v1.6.0
ActionMenu
This component is used to display a menu that will contain a list of menu options. The menu is dismissible if you click outside the dropdown.
Installation
To install @igloo-ui/action-menu
in your project, you will need to run the following command using npm:
npm install @igloo-ui/action-menu
If you prefer Yarn, use the following command instead:
yarn add @igloo-ui/action-menu
Usage
Then to use the component in your code just import it!
Displaying an action menu
import ActionMenu from '@igloo-ui/action-menu';
import Button from '@igloo-ui/button';
<ActionMenu
options={[
{
label: 'Add Item',
value: 'add',
},
{
label: 'Delete Item',
value: 'delete',
disabled: true,
},
{
label: 'Copy Item',
value: 'copy',
},
]}
renderReference={(refProps) => {
return (
<Button appearance="secondary" {...refProps}>
Button
</Button>
);
}}
/>;
Calling option events
import ActionMenu from '@igloo-ui/action-menu';
import Button from '@igloo-ui/button';
<ActionMenu
options={[
{
label: 'Add Item',
value: 'add',
icon: <AddSolid size="medium" />,
onClick: () => {
alert('"Add Item" was clicked');
},
},
{
label: 'Delete Item',
value: 'delete',
icon: <Delete size="medium" />,
onClick: () => {
alert('"Delete Item" was clicked');
},
closeOnSelect: () => {
// Put some condition here
// It can also just be a boolean and not a function
return false;
},
},
{
label: 'Copy Item',
value: 'copy',
icon: <Copy size="medium" />,
onClick: () => {
alert('"Copy Item" was clicked');
},
},
]}
renderReference={(refProps) => {
return (
<Button appearance="secondary" {...refProps}>
Button
</Button>
);
}}
/>;
1.6.0
9 months ago
1.5.11
9 months ago
1.5.10
10 months ago
1.5.9
11 months ago
1.5.8
1 year ago
1.5.7
1 year ago
1.5.6
1 year ago
1.5.5
1 year ago
1.5.4
1 year ago
1.5.3
1 year ago
1.5.2
1 year ago
1.5.1
1 year ago
1.5.0
1 year ago
1.4.1
1 year ago
1.4.0
1 year ago
1.3.5
1 year ago
1.3.4
1 year ago
1.3.3
1 year ago
1.3.2
2 years ago
1.2.0
2 years ago
1.1.4
2 years ago
1.3.1
2 years ago
1.1.3
2 years ago
1.3.0
2 years ago
1.2.1
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.0
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago
0.0.0
2 years ago