Menu Component

The Menu component is a Primary Fields component that attaches a drop-down list of customizable options to an element. For example, if your page has a Button component labeled Settings, and you want to display options when an end-user clicks it, use the Menu component to create the drop-down effect.

The Menu component is a Vega (2.0) runtime component and is not supported in the Centauri (1.0) runtime.

To learn more about general component settings, view our General Component Settings article.

Field Text

A static image displaying the Menu component's Display settings.

Setting

Description

Label Text

Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field.

User-friendly labels make your module more accessible. Keep labels short and descriptive (a word or two) using title case. For longer entries, use sentence case.

Default State Options

Setting

Description

Hide Field

Displays or hides the component from view. Setting Hide Field to  (ON) hides the component in Express View. Setting it to (OFF) displays the component. The component is always visible in the Module Builder.

By default, Hide Field is set to (OFF).

Anchor Location

Setting

Description

propertyID

To attach the Menu component to another component, enter the component's Property ID. For example, enter a Button component's Property ID in this field to attach the Menu component to the button. In Express View, when an end-user clicks the button, the menu displays below it.

In this example, configure a Button component to trigger a Menu component.

These instructions assume that you have an open module saved with a title.

Configure the Button Component

The Button component acts as the visual anchor for the menu component. Your end-users click the button to display the menu underneath.

1. In the Module Builder, drag and drop a Button component Icon Button component onto the canvas.
2. In the Property ID field, enter btnMenu.
3. In the Label Text field, enter Navigate.
4. Navigate to the Actions settings
5. Under Action Type, click Event.

You'll configure the btnMenu Button component Icon Button component's Operations Builder settings after configuring the Menu component.

6. Click Save Component.

Configure the Menu Component

A static image displaying the Menu component's Data Values table. The first three rows are filled out with Options.

Configure a Menu component to anchor to the Button component. You can also configure options based on your needs.

1. Drag and drop a Menu component onto the canvas, placing it below the initMenu Radio Button component icon Initializer component.
2. In the Property ID field, enter menuNav.
3. In the Label Text field, enter menuNav.
4. Under Anchor Location, in the propertyID field, enter btnMenu. This attaches the menu to the Button component in Express View.
5. Navigate to the Data settings.
6. In the Values table, enter the following:

 

Label Value Action

1

Option A

menu1

 

2

Option B

menu2

 

3

Option C

menu3

 

You can configure options to perform a certain function using the Action setting. For example, each option could direct the end-user to another module, reveal hidden components, trigger a workflow, and so on.

7. Click Save Component.

Configure the Button Component's Operations Builder

1. Open the Button component Icon Button component's configuration pane.
2. Navigate to the Actions settings.
3. Next to Events & Operations, click Edit.
4. From the Add Event* drop-down, enter or select the On Click event.
5. In the Operation Type* field, enter or select TOGGLE.
6. In the Summary field, enter Open Menu on Button Click.
7. In the Target Key* field, enter or select menuNav.
8. In the Property* field, enter open.

A static image displaying the Button component's Operation builder. the Operation type is set to Toggle, and the fields are filled out.

9. Click Save Operation to close the New Operation window. The operation displays in the Operations Builder configuration window as a new row. The Operation Type and Operation Summary values display inside the row.
10. Click Save Component to close the Operations Builder modal.
11. Save your module.

Preview your module in Express View. Click the Navigate button to display the menu:

Using the example above, execute the Vega Console command UNQENG.tools.getComponentState('imageLogo') in the DevTools Console to display the component's data structure:

A static image displaying a Menu component in the DevTools Console view.