> For the complete documentation index, see [llms.txt](https://docs.appfarm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appfarm.io/library/ui-components/view-container.md).

# View container

A View Container is used for plugging in other views inside a view.

A View Container is not available inside custom components. It is disabled in the components list there.

{% hint style="info" %}
Showroom: [View Container example](https://showroom.appfarm.app/ui-components/view-container), with its setup in Appfarm Create ([register](https://showroom.appfarm.app/sign-up) for access).
{% endhint %}

{% tabs %}
{% tab title="Example 1" %}
A View Container might be used when you want to reuse a user interface across other user interfaces. E.g. when you have multiple views listing Orders, and would like to use the same preview pane for "order" across these views
{% endtab %}

{% tab title="Example 2" %}
You want to have a main view with a static header and left menu, but want the contents of the page to change. In that case, you may add a View Container holding all the views to be displayed (e.g. "Orders", "Products", and "Users"). The menu has items "Orders", "Products" and "Users", and the click action for the menu items uses the action node "Navigate" (e.g. Navigate: Sub View = Orders).
{% endtab %}
{% endtabs %}

## Settings

### Transition

Used to set how the visual transition when navigating between the views of the View Container should appear.

* *None*: Default transition. No transition animation will occur.
* *Fade*: Fades out the previous view, and fades in the new.
* *Slide*: Sideways slide animation. The slide direction follows the order of the views added to the View Container
* *Zoom*: Zoom in on the next view.

### Views

Add one or more views to be visible in the View Container.

The View Container shows one view at a time. It checks the views in list order and shows the first match:

* A **Conditional** view matches when its **Visible** condition is true.
* Any other view matches when the URL's sub view (`URL Path.Sub View`) points to it.

If nothing matches and the URL has no sub view, the first view that is not Conditional is shown.

#### Conditional

You may set conditions on which of the views should be visible or not, instead of letting the `URL Path.Sub View` control which view to display. Checking **Conditional** adds a **Visible** setting to the view, where you set the condition.


---

# 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.appfarm.io/library/ui-components/view-container.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.
