# TabStrip State Management

The Telerik TabStrip for Blazor exposes state management capabilities through events and methods. Use them to save, restore, and programmatically manipulate the component state, for example, to persist it across page visits or to respond to state changes.

## Objects

The TabStrip stores its state in the following objects:

* [`TabStripState`](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.tabstripstate)—the state of the TabStrip component and all tabs
* [`TabStripTabState`](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.tabstriptabstate)—the state of a specific tab

## Events

The TabStrip fires two events that enable you to monitor the component state or set it initially:

* [`OnStateChanged`](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/events#onstatechanged)
* [`OnStateInit`](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/events#onstateinit)

Also see the [example](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/state#example) below.

## Methods

The [`GetState` and `SetState` methods](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.teleriktabstrip#methods) of the [TabStrip instance](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/overview#tabstrip-reference-and-methods) let you obtain and define the current TabStrip state on demand at any time after `OnStateInit`.

To make changes to the TabStrip state:

1. Get the current state with the `GetState` method.
2. Apply the desired modifications to the obtained `TabStripState` object.
3. Set the modified state object through the `SetState` method.

> Do not use `GetState()` in the `OnStateInit` or `OnStateChanged` events. Do not use `SetState()` in `OnStateInit`. Instead, get or set the `TabStripState` property of the event argument.

## Example

The following sample demonstrates the TabStrip state-related events and methods in action.

<demo metaUrl="client/tabstrip/state/example-1/" height="620"></demo>

## Next Steps

* [Handle TabStrip events](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/events)

## See Also

* [TabStrip Tab Position and Alignment](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/tabs-position)
* [TabStrip Tab Scrolling or Overflow Menu](https://www.telerik.com/blazor-ui/documentation/components/tabstrip/scrollable-tabs)
