# Tabs

> Switches between panels of content.

- Category: [Navigation](https://tarve.dev/docs.md#navigation)
- Import: `import { Tabs } from "@tarve/core";`
- Props type: `TabsProps`
- Source: [packages/core/src/controls.ts:186](https://github.com/omarcosr/tarve/blob/main/packages/core/src/controls.ts#L186)

## Usage

```tsx title="Tabs.tsx"
import { Tabs, Text } from "@tarve/core";

let tab = "account";

<Tabs
  value={tab}
  items={[
    { value: "account", label: "Account", content: <Text>Account settings</Text> },
    { value: "password", label: "Password", content: <Text>Change your password</Text> },
  ]}
  onValueChange={(value) => {
    tab = value;
  }}
/>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `items` (required) | `TabItem[]` | — |  |
| `value` (required) | `string` | — |  |
| `onValueChange` | `(value: string) => void` | — |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

## Types

```ts title="TabItem"
interface TabItem { value: string; label: string; content: Child; disabled?: boolean }
```

Previous: [CommandPalette](https://tarve.dev/docs/components/CommandPalette.md) · Next: [Accordion](https://tarve.dev/docs/components/Accordion.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/Tabs · Index for agents: https://tarve.dev/llms.txt
