Building Left-Side Vertical Navigation
Last updated
Was this helpful?
Last updated
Was this helpful?
This tutorial will walk you through creating a left-side vertical navigation menu for your app using the Avonni Navigation component. You'll learn key concepts, best practices, and helpful tips to improve your app's overall user experience.
By the end of this tutorial, you'll be able to
Confidently build intuitive and user-friendly left-side navigation menus
Understand how to use Avonni Flow Screen Components effectively
Create Reusable Navigation Items: We'll use Avonni's "Navigation Item Collection" tool to define global navigation items that can be used throughout your app. This saves development time and makes your interface more consistent.
Set Up Navigation Logic: We'll add a "router" to control the screen shown when a user clicks on a navigation item.
Build the Screens: We'll create the screens for each navigation item and connect them to the left-menu navigation component. This keeps the look and feel of your app unified.
The final step will be revealed later in the tutorial. (Keep reading to find out!)
Defining global navigation items using the Avonni Apex Action: "Navigation Item Collection
" allows you to create navigation items once and reuse them throughout your screens.
How do we define global navigation items?
Here's a step-by-step guide to defining global navigation items with Avonni's Apex Action, "Navigation Item Collection
":
🎬 Start by adding an action element at the top of your screen flow.
🎯 In the left menu, choose "Avonni".
🔍 Find "New Navigation Item Collection" from the dropdown menu.
🏷️ Provide a label for your collection.
➕ Add the navigation items you want included in your Avonni Navigation component.
🧩 Under the advanced section, opt for "Manually assign variable".
📤 Create a new output resource called "navigationItems
".
🔄 In the Data Type dropdown, pick "Apex Defined".
🌐 Enable the "Allow multiples values (collection)" checkbox.
👨💻 In the Apex Class dropdown menu, select "avcmpbuilder__NavigationItem".
💾 Don't forget to hit "Save" to apply your settings.
Adding a router element to our flow is a great way to define the order of outcomes for your flow. Each outcome can be mapped to a specific navigation item, which manages its screen element, leading to a well-structured and intuitive user interface.
How to do it?
Here's your guide to adding a router element to your flow and mapping outcomes to navigation items for an intuitive user interface:
✏️ Start by creating a text variable "activeNavItem". Add a default value corresponding to the first item in your left vertical navigation menu.
🧩 Add a decision element below the previously created NavItems Apex Action.
🗂️ Define the order of your outcomes. This order will generally mirror your vertical-left navigation menu.
🏷️ Assign a label to each outcome for identification.
🔄 Select the "activeNavItem" resource variable for each outcome.
📐 Set the operator to 'Equal'.
📋 Provide a value name for your activeNavItem resource (usually similar to the label, but without spaces).
🔁 Repeat this process for each outcome in your decision element.
✔️ Once all outcomes are defined, click "Done" to finalize.
We'll add these screen elements to each decision outcome and populate them with consistent components. This ensures a uniform look and feel across all screens, contributing to a cohesive user experience.
For the Avonni Navigation component, after assigning the Data source to the Navigation items (as created in Step 1), it's crucial to configure an interaction that triggers navigation to the next screen. Specifically, the Avonni Navigation component needs an interaction configured to advance the flow. This ensures that the flow process continues as expected and proceeds to the next step, the assignment process we'll define in Step 4 below.
One key step involves adding an assignment element to our screen flow, following the screen element we've added for each navigation item.
This step is essential because it allows us to assign a specific value to each screen for the active menu item. By doing so, we create a clear link between the selection in our navigation component and the content displayed on the screen.
In this final step, we'll connect each decision outcome from our routers to the Avonni NavItems Apex action. This connection is essential for restarting the screen flow process when selecting a navigation item.
Think of this "Connect To Element" as a bridge. It links each possible outcome of your routing logic to the Apex action that controls the Avonni Navigation component. By establishing this connection, we ensure that clicking a navigation item triggers the corresponding decision outcome and restarts the flow.
You must repeat this connection process for every navigation item within each assignment. This ensures that every navigation item click restarts the flow, regardless of which assignment it belongs to.
Having trouble with this tutorial? Contact Avonni support for help.
In this step, we'll create screens tailored to each decision outcome. Since we're building a left-menu vertical navigation component using the , each decision must have a corresponding screen element.