# Tabs

Connected tab buttons and retained content panels with roving keyboard focus.

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"use client";

import { FloodRoot, Tabs } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Tabs label="Project sections" items={[{value:"overview",label:"Overview",content:"Project context."},{value:"activity",label:"Activity",content:"Recent updates."}]} />
    </FloodRoot>
  );
}
```

## Design notes

- Arrow keys navigate enabled tabs; automatic activation is default, manual needs Enter/Space. Tab leaves the tablist. Horizontal direction follows RTL.
- Inactive panels remain mounted but hidden. Keep form validation and persistent selection under host control. Invalid, missing or disabled selected values fall back to the first available item.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `label` | `string` | `Required` |
| `items` | `readonly TabItem[]` | `Required` |
| `value` | `string` | `—` |
| `defaultValue` | `string` | `—` |
| `onValueChange` | `(value: string) => void` | `—` |
| `activationMode` | `"automatic" \| "manual"` | `"automatic"` |
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` |
| `controlSize` | `"sm" \| "md" \| "lg" \| "xl"` | `"md"` |
| `disabled` | `boolean` | `false` |
| `iconOnly` | `boolean` | `false` |
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children" \| "defaultValue" \| "onChange">` | `Forwarded` |
