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 |
| String Id of the menu. |
anchor_align |
| Symbol One of |
anchor_side |
| Symbol One of |
size |
| Symbol One of |
src |
| String Used with an |
preload |
| Boolean When true, and src is present, loads the |
dynamic_label |
| Boolean Whether or not to display the text of the currently selected item in the show button. |
dynamic_label_prefix |
| String If provided, the prefix is prepended to the dynamic label and displayed in the show button. |
select_variant |
| Symbol One of |
form_arguments |
| Hash Allows an |
system_arguments | N/A | Hash |
Examples
Slots
show_button
Button to activate the menu.
Name | Default | Description |
---|---|---|
system_arguments | N/A | Hash The arguments accepted by |
items
Adds a new item to the list.
Name | Default | Description |
---|---|---|
system_arguments | N/A | Hash The 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 | Hash The arguments accepted by |
with_item
Adds a new item to the list.
Name | Default | Description |
---|---|---|
system_arguments | N/A | Hash The arguments accepted by ActionList::Item. |
with_divider
Adds a divider to the list.
Name | Default | Description |
---|---|---|
system_arguments | N/A | Hash The 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 | String ID of the parent menu. |
system_arguments | N/A | Hash The arguments accepted by ActionList |
Slots
heading
Heading text rendered above the list of items.
Name | Default | Description |
---|---|---|
system_arguments | N/A | Hash The arguments accepted by ActionList::Heading. |
items
Items.
Name | Default | Description |
---|---|---|
system_arguments | N/A | Hash The arguments accepted by ActionList::Item. |
Methods
with_item
Adds a new item to the list.
Name | Default | Description |
---|---|---|
data |
| Hash When 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 | Hash The same arguments accepted by ActionList::Item. |