> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/gum/gum-tool/forms-controls/tabcontrol.md).

# TabControl

## Introduction

A TabControl has a tab strip and a content area. You build it by placing `TabItem` instances in the strip and `TabPage` instances in the content area. Tab 1 shows page 1, tab 2 shows page 2, and so on, so the tabs and pages must be in the same order.

{% hint style="info" %}
Available in December 2026, or now if building Gum from source.
{% endhint %}

For using a TabControl in code, see [TabControl](https://docs.flatredball.com/gum/code/controls/tabcontrol.md).

## Adding Tabs and Pages

The TabControl component has two slots: `InnerPanelInstance` is the tab strip and `ContentPanelInstance` is the content area. See [Is Slot](https://docs.flatredball.com/gum/gum-tool/gum-elements/general-properties/is-slot.md) for how slots work.

1. Add a TabControl instance to a screen or component.
2. Drag a `TabItem` onto the TabControl. The TabControl's [Default Slot](https://docs.flatredball.com/gum/gum-tool/gum-elements/component/default-child-container.md) is the tab strip, so the TabItem's `Parent` becomes `TabControlInstance.InnerPanelInstance`.
3. Set `Header` on the TabItem to the text of the tab. Each new TabItem reads `Tab` until you change it.
4. Drag a `TabPage` onto the TabControl. Change its `Parent` to `TabControlInstance.ContentPanelInstance`, since the default slot would put it in the tab strip.
5. Drag the content of the page onto the TabPage. A TabPage's default slot is its own content container.
6. Repeat steps 2 to 5 for each tab, adding the TabItems and the TabPages in the same order.

Replace `TabControlInstance` above with the name of your instance.

## Selected Tab

`SelectedIndex` on the TabControl instance picks the selected tab, starting at `0`. The tool shows the selected tab and its page, and hides the other pages. Changing `SelectedIndex` is a quick way to check each page while you edit it.


---

# 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.flatredball.com/gum/gum-tool/forms-controls/tabcontrol.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.
