> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/tutorials/components/navigation/build-tabs-on-one-screen-with-navigation.md).

# Build Tabs on One Screen with Navigation

Build a tab bar on one flow screen that shows Overview, Contacts, Opportunities or Cases of an account, with no extra screens and no Next click.

A service agent opens a screen flow from an account and needs its contacts, opportunities and cases without leaving the screen. Four screens with Next and Previous buttons make that slow. One screen with a menu across the top, where each item reveals its own section, keeps everything one click away.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FPs2vOiw9FvVqEhBquW0d%2Fbuild-tabs-on-one-screen-with-navigation-result.png?alt=media" alt="A horizontal menu with the Cases item active and the account open cases listed below it"><figcaption><p>Clicking Cases shows the Cases section and hides the other three.</p></figcaption></figure>

## Before you start

* A screen flow that receives the account Id, for example a text input variable `recordId`.
* The records each tab shows, fetched before the screen (one **Get Records** per object, filtered on `AccountId` equals `{!recordId}`).
* The [Navigation](https://docs.avonnicomponents.com/flow/flow-components/navigation.md) component reference, for every property this page does not use.

## Steps

{% stepper %}
{% step %}

### Add the Navigation at the top of the screen

1. Add a **Screen** element and drag the **Avonni Navigation** component to the top of it.
2. Give it a clear API name, for example `AccountTabs`. You will pick it by that name in every visibility rule.
3. Click **Open Component Builder**.
4. Keep **Orientation** on **Horizontal** (the default). A horizontal Navigation reads as a row of tabs.
   {% endstep %}

{% step %}

### Create the four items

1. Keep the **Manual** data source and click **Add Items** under **Items** four times.
2. Give each item a **Label** and a **Value**:

| Label         | Value           |
| ------------- | --------------- |
| Overview      | `overview`      |
| Contacts      | `contacts`      |
| Opportunities | `opportunities` |
| Cases         | `cases`         |

3. Set **Active Navigation Item Value** to `overview`, so the screen opens on the first tab.

Your visibility rules compare the value, never the label. Keep values lowercase with no spaces, and do not change them once the rules exist. You can rename a label at any time, but a renamed value breaks every rule that uses it, with no error.
{% endstep %}

{% step %}

### Add one section per tab

1. Below the Navigation, add four **Section** components to the screen, one per tab.
2. Put what each tab shows inside its section: a **Display Text** with the account details in the first, a data table of `{!Get_Contacts}` in the second, and so on.

Any component works inside a section. The section is only the container that you show or hide.
{% endstep %}

{% step %}

### Show each section only for its tab

Select the Contacts section, open **Set Component Visibility** and add one condition:

* **Resource**: `AccountTabs` > **Active Navigation Item Value**
* **Operator**: **Equals**
* **Value**: `contacts`

Repeat for Opportunities (`opportunities`) and Cases (`cases`).

For the Overview section, choose **Any Condition Is Met (OR)** and add two conditions: **Active Navigation Item Value** **Equals** `overview`, and **Active Navigation Item Value** **Is Null** `True`. The second one keeps Overview visible if the default value is ever cleared.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FNw7TwwYPN2QrILYYh60a%2Fbuild-tabs-on-one-screen-with-navigation-visibility.png?alt=media" alt="Set Component Visibility condition comparing the Navigation active item value to contacts"><figcaption><p>The Contacts section shows only when the active item value is contacts.</p></figcaption></figure>
{% endstep %}

{% step %}

### Save and test

Save the flow and click **Debug** with an account Id. The screen opens on Overview with the Overview tab highlighted. Click **Cases**: the Overview section disappears and the Cases section appears in its place. The flow stays on the same screen.
{% endstep %}
{% endstepper %}

This works because the Navigation sends the new **Active Navigation Item Value** to the screen as soon as an item is selected, and Flow re-evaluates the visibility rules that read it without leaving the screen.

## Troubleshooting

<details>

<summary>Clicking a tab changes nothing</summary>

Check the **Value** in the visibility rule against the item's **Value**, character for character. `Cases` and `cases` are two different values. Then check that the rule points at the Navigation's **Active Navigation Item Value**, not at a flow variable of the same name.

</details>

<details>

<summary>No section shows when the screen opens</summary>

**Active Navigation Item Value** is empty or holds a value that matches no rule. Set it to `overview`, or add the **Is Null** condition to the Overview section as in step 4.

</details>

<details>

<summary>Two sections show at once</summary>

Two rules compare against the same value. Each section needs its own value.

</details>

## Related tutorials

* [Reuse one menu across a multi-screen flow](https://docs.avonnicomponents.com/flow/tutorials/components/navigation/reuse-one-menu-across-a-multi-screen-flow.md): when each tab needs its own screen, for example a form with its own validation.
* [Add sub-menus and columns to a navigation menu](https://docs.avonnicomponents.com/flow/tutorials/components/navigation/add-sub-menus-and-columns-to-a-navigation-menu.md): split Cases into Open and Closed under one tab.
* [Build a navigation menu from a picklist](https://docs.avonnicomponents.com/flow/tutorials/components/navigation/build-a-navigation-menu-from-a-picklist.md): when the tabs are the values of a field, such as case statuses.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/flow/tutorials/components/navigation/build-tabs-on-one-screen-with-navigation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
