# Blazor TabStrip Overview

The <a href = "https://www.telerik.com/blazor-ui/tabstrip" target = "_blank">Blazor TabStrip component</a> displays a collection of tabs, containing associated content, which enable the user to switch between different views inside a single component.

## Comparison with ButtonGroup and SegmentedControl

The ButtonGroup, SegmentedControl, and TabStrip are similar and even inter-changeable in some aspects. The major differences between these components are:

* The [ButtonGroup](https://www.telerik.com/blazor-ui/documentation/components/buttongroup/overview) supports single and multiple selection. The SegmentedControl and TabStrip can only have one selected (active) item.
* The [SegmentedControl](https://www.telerik.com/blazor-ui/documentation/components/segmentedcontrol/overview) is a databound component. The ButtonGroup and TabStrip use declarative items as child components.
* The [TabStrip](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/overview) renders content containers and manages their visibility out-of-the-box. The ButtonGroup and SegmentedControl can also integrate with separate content containers, but this must rely on the component events and a custom implementation.

## Creating Blazor TabStrip

1. Use the `<TelerikTabStrip>` tag.
2. Add a nested `<TabStripTab>` tag for each tab you want to include in the component.
3. Set tab titles through the `Title` parameter of the `<TabStripTab>` tags.
4. Place the desired content in each tab, including HTML markup and Razor components.

> caption Basic Blazor TabStrip

<demo metaUrl="client/tabstrip/overview/" height="420"></demo>

## ActiveTabId Parameter

The TabStrip `ActiveTabId` parameter allows you to manage the active tab by its `string` ID. The parameter supports two-way binding through an [`ActiveTabIdChanged` `EventCallback`](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/events#activetabidchanged), allowing seamless updates between the component and the application state.

To deactivate all tabs, set the ActiveTabId parameter to `string.Empty`.

> caption Using the TabStrip `ActiveTabId` parameter

<demo metaUrl="client/tabstrip/overview/example-1/" height="420"></demo>

## Tab Position and Alignment

The TabStrip can position tabs on any side of the component. Tab alignment controls how tabs are distributed in the selected position.

For more details, see the [TabStrip Position and Alignment](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/tabs-position) article.

## Tab Overflow and Scrolling

When tabs do not fit in the available space, the TabStrip provides three built-in behaviors: wrapping to multiple rows (default), scrolling, or collapsing overflowing tabs into a dropdown menu.

For more details, see the [TabStrip Scrollable Tabs and Overflow Menu](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/scrollable-tabs) article.

## Persist Content

By default, the TabStrip destroys the content of inactive tabs when the user switches tabs and re-initializes it when the tab becomes active again. To keep all tab content in the DOM and hide inactive tabs with CSS only, see the [TabStrip Persist Content](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/persist-content) article.

## Tab Reordering and Pinning

The TabStrip lets users reorder tabs by drag-and-drop and pin important tabs to a fixed position. See \[Tab Reordering and Pinning] for details.

## Templates

The TabStrip allows you to replace the plain text in the tab headers with custom HTML markup or components. You can also add custom content next to the tabs, for example, and **Add** button. For more details, see the [TabStrip Templates](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/templates) article.

## Dynamic Tabs

The TabStrip supports dynamic tab management, allowing you to add, remove, show, or hide tabs at runtime by iterating a collection of objects. For more details, see the [TabStrip Dynamic Tabs](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/tabs-collection) article.

## More TabStrip Features

* [State Management](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/state)—Save, restore, and programmatically control the TabStrip state to persist it across page visits.
* [Events](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/events)—Handle events such as `ActiveTabIdChanged`, `OnTabReorder`, `PinnedChanged`, and `VisibleChanged` to respond to user interactions.

## TabStrip API

Get familiar with all TabStrip parameters, methods, and events in the [TabStrip API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.teleriktabstrip) and the [`TabStripTab` API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.tabstriptab).

## TabStrip Reference and Methods

The Blazor TabStrip component exposes methods for programmatic operation. To use them, define a reference to the component instance with the `@ref` directive attribute.

> caption Get a reference to the TabStrip instance and use its methods

```RAZOR.skip-repl
<TelerikTabStrip @ref="@TabStripRef" />

@code {
    private TelerikTabStrip? TabStripRef { get; set; }
}
```

## Next Steps

* [Set the TabStrip tab position and alignment](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/tabs-position)
* [Enable tab scrolling or overflow](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/scrollable-tabs)
* [Persist tab content on active tab change](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/persist-content)
* [Reorder and pin tabs](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/tab-reorder)
* [Customize TabStrip UI with templates](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/templates)
* [Change the number of tabs at runtime](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/tabs-collection)
* [Manage TabStrip state](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/state)
* [Handle TabStrip events](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/events)

## See Also

* [Live Demo: TabStrip](https://demos.telerik.com/blazor-ui/tabstrip/overview)
* [TabStrip API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.teleriktabstrip)
* [TabStripTab API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.tabstriptab)
