---
title: TabBar
description: TabBar API.
---

import CodeSnippetMD from '@slint/common-files/src/components/CodeSnippetMD.astro';
import SlintProperty from '@slint/common-files/src/components/SlintProperty.astro';

<CodeSnippetMD imagePath="/src/assets/generated/tabbar.png" scale="3" imageWidth="300" imageHeight="200" imageAlt="">
```slint
import { TabBar } from "@material";
export component Example inherits Window {
    width: 400px;
    height: 100px;
    background: transparent;
    TabBar {
        width: parent.width;
        items: [
            { icon: @image-url("../icons/share.svg"), text: "Home" },
            { icon: @image-url("../icons/search.svg"), text: "Search" },
            { icon: @image-url("../icons/settings.svg"), text: "Settings" }
        ];
    }
}
```
</CodeSnippetMD>

A `TabBar` displays a row of tabs for navigation between different views or content sections.

## Properties

### current-index
<SlintProperty propName="current-index" typeName="int" propertyVisibility="in-out">
The index of the currently selected tab.
</SlintProperty>

### items
<SlintProperty propName="items" typeName="[struct]" structName="NavigationItem">
An array of tab items to display in the bar.
</SlintProperty>

## Callbacks

### index-changed(index: int)
Invoked when the `current-index` changes.