Action menu
Action menu is composed of action list and overlay patterns used for quick actions and selections.
Description
ActionMenu is used for actions, navigation, to display secondary options, or single/multi select lists. They appear when users interact with buttons, actions, or other controls.
The only allowed elements for the Item components are: :a, :button, and :clipboard-copy. The default is :button.
Arguments
| Name | Default | Description |
|---|---|---|
menu_id |
| StringId of the menu. |
anchor_align |
| SymbolOne of |
anchor_side |
| SymbolOne of |
size |
| SymbolOne of |
src |
| StringUsed with an |
preload |
| BooleanWhen true, and src is present, loads the |
dynamic_label |
| BooleanWhether or not to display the text of the currently selected item in the show button. |
dynamic_label_prefix |
| StringIf provided, the prefix is prepended to the dynamic label and displayed in the show button. |
select_variant |
| SymbolOne of |
form_arguments |
| HashAllows an |
system_arguments | N/A | Hash |
Examples
Slots
show_button
Button to activate the menu.
| Name | Default | Description |
|---|---|---|
system_arguments | N/A | HashThe arguments accepted by |
items
Adds a new item to the list.
| Name | Default | Description |
|---|---|---|
system_arguments | N/A | HashThe arguments accepted by ActionList::Item. |
Methods
list
Returns the value of attribute list.
preload
Returns the value of attribute preload.
preload?
Returns the value of attribute preload.
with_show_button
Button to activate the menu.
| Name | Default | Description |
|---|---|---|
system_arguments | N/A | HashThe arguments accepted by |
with_item
Adds a new item to the list.
| Name | Default | Description |
|---|---|---|
system_arguments | N/A | HashThe arguments accepted by ActionList::Item. |
with_divider
Adds a divider to the list.
| Name | Default | Description |
|---|---|---|
system_arguments | N/A | HashThe arguments accepted by ActionList's |
ActionMenu::List
This component is part of ActionMenu and should not be used as a standalone component.
Arguments
| Name | Default | Description |
|---|---|---|
menu_id | N/A | StringID of the parent menu. |
system_arguments | N/A | HashThe arguments accepted by ActionList |
Slots
heading
Heading text rendered above the list of items.
| Name | Default | Description |
|---|---|---|
system_arguments | N/A | HashThe arguments accepted by ActionList::Heading. |
items
Items.
| Name | Default | Description |
|---|---|---|
system_arguments | N/A | HashThe arguments accepted by ActionList::Item. |
Methods
with_item
Adds a new item to the list.
| Name | Default | Description |
|---|---|---|
data |
| HashWhen the menu is used as a form input (see the ActionMenu docs), the label is submitted to the server by default. However, if the |
system_arguments | N/A | HashThe same arguments accepted by ActionList::Item. |