---
url: /reference/items/Tabs/examples.md
---
# Examples
## Simple
The template renders the whole `tablist` / `tab` / `tabpanel` structure. `label` names the tab list, `list_attr` styles it, and the selected tab is the one CSS selects with `[aria-selected="true"]` — the component writes no inline style.
:::code-group
```js
import { registerComponent } from '@studiometa/js-toolkit';
import { Tabs } from '@studiometa/ui';
registerComponent(Tabs);
```
:::
## Transitioned panels
`Tabs` calls `enter()` and `leave()` on the [`Transition`](../Transition/index.md) and [`ViewTransition`](../ViewTransition/index.md) components inside each panel, and hides the closing panel only once its transitions have resolved. This replaces the `styles` option of v1.
This example also uses `data-option-activation="manual"`, so the arrow keys move the focus and Enter or Space switches the panel.
:::code-group
```js
import { registerComponents } from '@studiometa/js-toolkit';
import { Tabs, Transition } from '@studiometa/ui';
registerComponents(Tabs, Transition);
```
:::