# Controlling the State

The `PanelBar` allows you to set an initial `selected`, `expanded`, or `focused` state for its items.

To set the initial state of the PanelBar, you can [use the props of the component](https://www.telerik.com/kendo-react-ui/components/layout/panelbar/controlling-state#using-the-props)

## Using the Props

To set the initial state of the PanelBar, provide a `uniquePrivateKey`. The `uniquePrivateKey` option is generated by the component itself and adopts a specific pattern that applies to each `PanelBarItem`:

* The generation starts from the first item, which is `'.0'`. The items from the same level of depth are generated respectively as `'.1'`, `'.2'`, and so on.
* The children of the first item are respectively `'.0.0'`, `'.0.1'`, `'.0.2'`, and so on.

[Demo Source](https://demos.telerik.com/kendo-react-ui/layout/panelbar/controlled/func/source.txt)

## Suggested Links

* [API Reference of the PanelBar](https://www.telerik.com/kendo-react-ui/components/layout/api/panelbarprops)
* [API Reference of the PanelBarItem](https://www.telerik.com/kendo-react-ui/components/layout/api/panelbaritemprops)
