> ## Documentation Index
> Fetch the complete documentation index at: https://www.beeq.design/llms.txt
> Use this file to discover all available pages before exploring further.

# Tab

> Tabs organize related content into separate panels under a single view, letting users switch between sections without navigating away from the page.

![BEEQ Tab component overview](https://mintlify.s3.us-west-1.amazonaws.com/beeq/components/images/tab/tab-overview-light.svg)

Tab component overview

Tabs let users navigate between related sections of content within the same page or view. Each tab reveals one panel at a time, keeping the interface clean while making multiple content sections available without navigation.

> [!NOTE]
>
> `bq-tab` must always be placed inside a `bq-tab-group`. The group manages tab state, keyboard navigation, and propagates `size`, `orientation`, and `placement` to all child tabs automatically.

## When to use

> [card]
>
> Use tabs when
>
> * Content can be clearly organized into a small number of distinct, peer-level sections
> * Users need to compare or switch between sections without losing page context
> * Space is limited and displaying all sections at once would clutter the layout
> * Each section can stand independently without requiring the user to read others first

> [card]
>
> Do not use tabs when
>
> * The number of tabs exceeds seven — prefer a sidebar navigation or dropdown instead
> * Content across sections is sequential and users must read them in order — prefer a stepper
> * Sections contain very different content types that do not relate to the same subject
> * The goal is to navigate to a new page or route — prefer anchor links or a navigation component

> [!TIP]
>
> Choose [`bq-tab`](https://www.beeq.design/components/tab) for a small set of peer sections where one panel is shown at a time and users switch freely in any order, [`bq-accordion`](https://www.beeq.design/components/accordion) for sections stacked on one page whose panels expand and collapse in place, and [`bq-steps`](https://www.beeq.design/components/steps) when the sections follow a fixed order with current, completed, and error states.

## Anatomy

![BEEQ Tab component anatomy](https://mintlify.s3.us-west-1.amazonaws.com/beeq/components/images/tab/tab-anatomy-light.svg)

Tab component anatomy

The tab group renders a list of tab buttons inside a scrollable container. Each individual tab consists of an optional icon, a text label, and an active-state underline indicator.

| Part | Element | Description |
| - | - | - |
| **1** | Active tab | The currently selected tab button, visually distinguished by brand color and the selected indicator |
| **2** | Inactive tab | A tab button that is not currently selected; clicking it activates it and deactivates the previous tab |
| **3** | Selected indicator | The underline beneath the active tab that marks the current selection |
| **4** | Text label | The visible label inside each tab button; placed in the default slot and exposed as the `text` shadow part |

## Design guidelines

### Orientation

![Horizontal](https://www.beeq.design/components/images/tab/tab-orientation-horizontal-light.svg)
![Horizontal](https://www.beeq.design/components/images/tab/tab-orientation-horizontal-dark.svg)

## Horizontal

The default orientation. Tabs are arranged in a row across the top of the content area. Best suited for most layouts.

![Vertical](https://www.beeq.design/components/images/tab/tab-orientation-vertical-light.svg)
![Vertical](https://www.beeq.design/components/images/tab/tab-orientation-vertical-dark.svg)

## Vertical

Tabs are stacked in a column to the left or right of the content area. Use when there are many tabs or when the layout is sidebar-based.

**Allowed `orientation` values:** `horizontal` (default), `vertical`.

### Size

**1. small**

Compact tabs with reduced padding. Use in dense interfaces or data-heavy views where space is constrained.

**2. medium**

The default size. Appropriate for most applications and standard-density layouts.

**3. large**

Prominent tabs with increased padding. Use when tabs are a primary navigation element or accessibility requires larger touch targets.

**Allowed `size` values:** `small`, `medium` (default), `large`.

> [!NOTE]
>
> Setting `size` on `bq-tab-group` propagates the value to all child `bq-tab` elements automatically. You do not need to set `size` on each tab individually.

### Placement

Use `placement="start"` (default) to left-align horizontal tabs or top-align vertical tabs. Use `placement="end"` to right-align horizontal tabs or bottom-align vertical tabs.

**Allowed `placement` values:** `start` (default), `end`.

## Usage

### Default

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-tab-group value="5">
  <bq-tab tab-id="1">Tab</bq-tab>
  <bq-tab tab-id="2">Tab</bq-tab>
  <bq-tab tab-id="3">Long Tab name</bq-tab>
  <bq-tab tab-id="4" disabled>Tab</bq-tab>
  <bq-tab tab-id="5">Tab</bq-tab>
  <bq-tab tab-id="6">Tab</bq-tab>
  <bq-tab tab-id="7">Tab</bq-tab>
  <bq-tab tab-id="8">Tab</bq-tab>
</bq-tab-group>
```

```tsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqTab, BqTabGroup } from "@beeq/react";

export default () => (
  <BqTabGroup value="5">
    <BqTab tabId="1">Tab</BqTab>
    <BqTab tabId="2">Tab</BqTab>
    <BqTab tabId="3">Long Tab name</BqTab>
    <BqTab tabId="4" disabled>Tab</BqTab>
    <BqTab tabId="5">Tab</BqTab>
    <BqTab tabId="6">Tab</BqTab>
    <BqTab tabId="7">Tab</BqTab>
    <BqTab tabId="8">Tab</BqTab>
  </BqTabGroup>
);
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqTab, BqTabGroup } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqTab, BqTabGroup],
  template: `
    <bq-tab-group value="5">
      <bq-tab tab-id="1">Tab</bq-tab>
      <bq-tab tab-id="2">Tab</bq-tab>
      <bq-tab tab-id="3">Long Tab name</bq-tab>
      <bq-tab tab-id="4" disabled>Tab</bq-tab>
      <bq-tab tab-id="5">Tab</bq-tab>
      <bq-tab tab-id="6">Tab</bq-tab>
      <bq-tab tab-id="7">Tab</bq-tab>
      <bq-tab tab-id="8">Tab</bq-tab>
    </bq-tab-group>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqTab, BqTabGroup } from "@beeq/vue";
</script>

<template>
  <BqTabGroup value="5">
    <BqTab tabId="1">Tab</BqTab>
    <BqTab tabId="2">Tab</BqTab>
    <BqTab tabId="3">Long Tab name</BqTab>
    <BqTab tabId="4" disabled>Tab</BqTab>
    <BqTab tabId="5">Tab</BqTab>
    <BqTab tabId="6">Tab</BqTab>
    <BqTab tabId="7">Tab</BqTab>
    <BqTab tabId="8">Tab</BqTab>
  </BqTabGroup>
</template>
```

## Options

### With icons

Tabs support an optional icon displayed before the label via the `icon` slot.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-tab-group value="5" size="small">
  <bq-tab tab-id="1">
    <bq-icon name="pulse" slot="icon"></bq-icon>
    Tab
  </bq-tab>
  <bq-tab tab-id="2">
    <bq-icon name="bell" slot="icon"></bq-icon>
    Tab
  </bq-tab>
  <bq-tab tab-id="3">
    <bq-icon name="airplane-in-flight" slot="icon"></bq-icon>
    Long Tab name
  </bq-tab>
  <bq-tab tab-id="4" disabled>
    <bq-icon name="airplane-tilt" slot="icon"></bq-icon>
    Tab
  </bq-tab>
  <bq-tab tab-id="5">
    <bq-icon name="align-right-simple" slot="icon"></bq-icon>
    Tab
  </bq-tab>
  <bq-tab tab-id="6">
    <bq-icon name="anchor" slot="icon"></bq-icon>
    Tab
  </bq-tab>
  <bq-tab tab-id="7">
    <bq-icon name="android-logo" slot="icon"></bq-icon>
    Tab
  </bq-tab>
</bq-tab-group>
```

```tsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqIcon, BqTab, BqTabGroup } from "@beeq/react";

export default () => (
  <BqTabGroup value="5" size="small">
    <BqTab tabId="1">
      <BqIcon name="pulse" slot="icon" />
      Tab
    </BqTab>
    <BqTab tabId="2">
      <BqIcon name="bell" slot="icon" />
      Tab
    </BqTab>
    <BqTab tabId="3">
      <BqIcon name="airplane-in-flight" slot="icon" />
      Long Tab name
    </BqTab>
    <BqTab tabId="4" disabled>
      <BqIcon name="airplane-tilt" slot="icon" />
      Tab
    </BqTab>
    <BqTab tabId="5">
      <BqIcon name="align-right-simple" slot="icon" />
      Tab
    </BqTab>
    <BqTab tabId="6">
      <BqIcon name="anchor" slot="icon" />
      Tab
    </BqTab>
    <BqTab tabId="7">
      <BqIcon name="android-logo" slot="icon" />
      Tab
    </BqTab>
  </BqTabGroup>
);
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqIcon, BqTab, BqTabGroup } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqTab, BqTabGroup],
  template: `
    <bq-tab-group value="5" size="small">
      <bq-tab tab-id="1">
        <bq-icon name="pulse" slot="icon"></bq-icon>
        Tab
      </bq-tab>
      <bq-tab tab-id="2">
        <bq-icon name="bell" slot="icon"></bq-icon>
        Tab
      </bq-tab>
      <bq-tab tab-id="3">
        <bq-icon name="airplane-in-flight" slot="icon"></bq-icon>
        Long Tab name
      </bq-tab>
      <bq-tab tab-id="4" disabled>
        <bq-icon name="airplane-tilt" slot="icon"></bq-icon>
        Tab
      </bq-tab>
      <bq-tab tab-id="5">
        <bq-icon name="align-right-simple" slot="icon"></bq-icon>
        Tab
      </bq-tab>
      <bq-tab tab-id="6">
        <bq-icon name="anchor" slot="icon"></bq-icon>
        Tab
      </bq-tab>
      <bq-tab tab-id="7">
        <bq-icon name="android-logo" slot="icon"></bq-icon>
        Tab
      </bq-tab>
    </bq-tab-group>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqIcon, BqTab, BqTabGroup } from "@beeq/vue";
</script>

<template>
  <BqTabGroup value="5" size="small">
    <BqTab tabId="1">
      <BqIcon name="pulse" slot="icon" />
      Tab
    </BqTab>
    <BqTab tabId="2">
      <BqIcon name="bell" slot="icon" />
      Tab
    </BqTab>
    <BqTab tabId="3">
      <BqIcon name="airplane-in-flight" slot="icon" />
      Long Tab name
    </BqTab>
    <BqTab tabId="4" disabled>
      <BqIcon name="airplane-tilt" slot="icon" />
      Tab
    </BqTab>
    <BqTab tabId="5">
      <BqIcon name="align-right-simple" slot="icon" />
      Tab
    </BqTab>
    <BqTab tabId="6">
      <BqIcon name="anchor" slot="icon" />
      Tab
    </BqTab>
    <BqTab tabId="7">
      <BqIcon name="android-logo" slot="icon" />
      Tab
    </BqTab>
  </BqTabGroup>
</template>
```

### Sizes

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<!-- Small -->
<bq-tab-group size="small" value="1">
  <bq-tab tab-id="1">Tab</bq-tab>
  <bq-tab tab-id="2">Tab</bq-tab>
  <bq-tab tab-id="3">Long Tab name</bq-tab>
</bq-tab-group>

<!-- Medium (default) -->
<bq-tab-group size="medium" value="1">
  <bq-tab tab-id="1">Tab</bq-tab>
  <bq-tab tab-id="2">Tab</bq-tab>
  <bq-tab tab-id="3">Long Tab name</bq-tab>
</bq-tab-group>

<!-- Large -->
<bq-tab-group size="large" value="1">
  <bq-tab tab-id="1">Tab</bq-tab>
  <bq-tab tab-id="2">Tab</bq-tab>
  <bq-tab tab-id="3">Long Tab name</bq-tab>
</bq-tab-group>
```

```tsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqTab, BqTabGroup } from "@beeq/react";

export default () => (
  <>
    {/* Small */}
    <BqTabGroup size="small" value="1">
      <BqTab tabId="1">Tab</BqTab>
      <BqTab tabId="2">Tab</BqTab>
      <BqTab tabId="3">Long Tab name</BqTab>
    </BqTabGroup>

    {/* Medium (default) */}
    <BqTabGroup size="medium" value="1">
      <BqTab tabId="1">Tab</BqTab>
      <BqTab tabId="2">Tab</BqTab>
      <BqTab tabId="3">Long Tab name</BqTab>
    </BqTabGroup>

    {/* Large */}
    <BqTabGroup size="large" value="1">
      <BqTab tabId="1">Tab</BqTab>
      <BqTab tabId="2">Tab</BqTab>
      <BqTab tabId="3">Long Tab name</BqTab>
    </BqTabGroup>
  </>
);
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqTab, BqTabGroup } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqTab, BqTabGroup],
  template: `
    <bq-tab-group size="small" value="1">
      <bq-tab tab-id="1">Tab</bq-tab>
      <bq-tab tab-id="2">Tab</bq-tab>
      <bq-tab tab-id="3">Long Tab name</bq-tab>
    </bq-tab-group>

    <bq-tab-group size="medium" value="1">
      <bq-tab tab-id="1">Tab</bq-tab>
      <bq-tab tab-id="2">Tab</bq-tab>
      <bq-tab tab-id="3">Long Tab name</bq-tab>
    </bq-tab-group>

    <bq-tab-group size="large" value="1">
      <bq-tab tab-id="1">Tab</bq-tab>
      <bq-tab tab-id="2">Tab</bq-tab>
      <bq-tab tab-id="3">Long Tab name</bq-tab>
    </bq-tab-group>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqTab, BqTabGroup } from "@beeq/vue";
</script>

<template>
  <!-- Small -->
  <BqTabGroup size="small" value="1">
    <BqTab tabId="1">Tab</BqTab>
    <BqTab tabId="2">Tab</BqTab>
    <BqTab tabId="3">Long Tab name</BqTab>
  </BqTabGroup>

  <!-- Medium (default) -->
  <BqTabGroup size="medium" value="1">
    <BqTab tabId="1">Tab</BqTab>
    <BqTab tabId="2">Tab</BqTab>
    <BqTab tabId="3">Long Tab name</BqTab>
  </BqTabGroup>

  <!-- Large -->
  <BqTabGroup size="large" value="1">
    <BqTab tabId="1">Tab</BqTab>
    <BqTab tabId="2">Tab</BqTab>
    <BqTab tabId="3">Long Tab name</BqTab>
  </BqTabGroup>
</template>
```

### Vertical

Set `orientation="vertical"` on `bq-tab-group` to stack tabs in a column beside the content area.

```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-tab-group orientation="vertical" value="1">
  <bq-tab tab-id="1">Tab</bq-tab>
  <bq-tab tab-id="2">Tab</bq-tab>
  <bq-tab tab-id="3">Long Tab name</bq-tab>
  <bq-tab tab-id="4" disabled>Tab</bq-tab>
</bq-tab-group>
```

```tsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqTab, BqTabGroup } from "@beeq/react";

export default () => (
  <BqTabGroup orientation="vertical" value="1">
    <BqTab tabId="1">Tab</BqTab>
    <BqTab tabId="2">Tab</BqTab>
    <BqTab tabId="3">Long Tab name</BqTab>
    <BqTab tabId="4" disabled>Tab</BqTab>
  </BqTabGroup>
);
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqTab, BqTabGroup } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqTab, BqTabGroup],
  template: `
    <bq-tab-group orientation="vertical" value="1">
      <bq-tab tab-id="1">Tab</bq-tab>
      <bq-tab tab-id="2">Tab</bq-tab>
      <bq-tab tab-id="3">Long Tab name</bq-tab>
      <bq-tab tab-id="4" disabled>Tab</bq-tab>
    </bq-tab-group>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqTab, BqTabGroup } from "@beeq/vue";
</script>

<template>
  <BqTabGroup orientation="vertical" value="1">
    <BqTab tabId="1">Tab</BqTab>
    <BqTab tabId="2">Tab</BqTab>
    <BqTab tabId="3">Long Tab name</BqTab>
    <BqTab tabId="4" disabled>Tab</BqTab>
  </BqTabGroup>
</template>
```

### No divider

Use `disable-divider` to hide the underline separator between the tab list and the content area.

```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-tab-group disable-divider value="1">
  <bq-tab tab-id="1">Tab</bq-tab>
  <bq-tab tab-id="2">Tab</bq-tab>
  <bq-tab tab-id="3">Long Tab name</bq-tab>
</bq-tab-group>
```

```tsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqTab, BqTabGroup } from "@beeq/react";

export default () => (
  <BqTabGroup disableDivider value="1">
    <BqTab tabId="1">Tab</BqTab>
    <BqTab tabId="2">Tab</BqTab>
    <BqTab tabId="3">Long Tab name</BqTab>
  </BqTabGroup>
);
```

```ts Angular icon="angular" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { Component } from "@angular/core";
import { BqTab, BqTabGroup } from "@beeq/angular/standalone";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqTab, BqTabGroup],
  template: `
    <bq-tab-group disable-divider value="1">
      <bq-tab tab-id="1">Tab</bq-tab>
      <bq-tab tab-id="2">Tab</bq-tab>
      <bq-tab tab-id="3">Long Tab name</bq-tab>
    </bq-tab-group>
  `,
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<script setup lang="ts">
import { BqTab, BqTabGroup } from "@beeq/vue";
</script>

<template>
  <BqTabGroup disableDivider value="1">
    <BqTab tabId="1">Tab</BqTab>
    <BqTab tabId="2">Tab</BqTab>
    <BqTab tabId="3">Long Tab name</BqTab>
  </BqTabGroup>
</template>
```

## Best practices

> [card]
>
> Do
>
> Keep tab labels short and parallel — prefer noun phrases like "Overview", "Details", or "Settings" rather than full sentences.

> [card]
>
> Don't
>
> Don't use tabs with only one or two items — a single visible section or a toggle is simpler and less visually heavy.

> [card]
>
> Do
>
> Always provide a `controls` attribute on each `bq-tab` pointing to the `id` of its associated panel element to meet ARIA requirements.

> [card]
>
> Don't
>
> Don't mix tabs of different sizes in the same tab group. Set `size` on `bq-tab-group` and let it propagate uniformly.

> [card]
>
> Do
>
> Use consistent tab labels across your interface — if some tabs have icons, apply icons to all tabs in the same group.

> [card]
>
> Don't
>
> Don't use tabs for actions or commands. Tabs are for navigation between content views, not for triggering operations like "Save" or "Delete".

> [card]
>
> Do
>
> Choose the orientation that matches your layout — use horizontal tabs for top-of-content placement and vertical tabs for sidebar-style navigation.

> [card]
>
> Don't
>
> Don't rely solely on the active-indicator underline for visual differentiation — ensure sufficient color contrast on the active tab label as well.

## Accessibility

`bq-tab-group` and `bq-tab` implement the [ARIA Tabs pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/):

* The tab list container has `role="tablist"`.
* Each `bq-tab` renders as a `<button role="tab">` with `aria-selected` and `aria-disabled` set automatically.
* The `controls` prop maps to `aria-controls`, linking each tab to its panel. You must provide a matching `id` on the panel element and `role="tabpanel"` for correct screen reader announcements.
* Keyboard navigation is handled by the tab group; see [Keyboard interaction](#keyboard-interaction).
* Focus management follows the roving `tabindex` pattern: only the active tab is in the tab order; other tabs are reachable via arrow keys.
* Disabled tabs have `aria-disabled="true"` and `disabled` set on the underlying button, removing them from interaction.

**Your responsibilities:**

* You must provide a meaningful `controls` value on each `bq-tab` that matches the `id` of the corresponding panel.
* You must add `role="tabpanel"` to each panel element.
* When using icons without a visible label, you must add a descriptive `aria-label` to the `bq-tab` so screen readers can identify the tab.

### Keyboard interaction

| Key | Context | Action |
| - | - | - |
| `Tab` | Focus outside the tab list | Moves focus to the active tab; inactive tabs have `tabindex="-1"` and are reached with the arrow keys |
| `ArrowRight` | Tab focused | Moves focus to the next enabled tab, wrapping from the last to the first, and selects it |
| `ArrowDown` | Tab focused | Moves focus to the next enabled tab, wrapping from the last to the first, and selects it |
| `ArrowLeft` | Tab focused | Moves focus to the previous enabled tab, wrapping from the first to the last, and selects it |
| `ArrowUp` | Tab focused | Moves focus to the previous enabled tab, wrapping from the first to the last, and selects it |
| `Enter` | Tab focused | Selects the focused tab (native button activation) |
| `Space` | Tab focused | Selects the focused tab (native button activation) |

Arrow keys work in both `horizontal` and `vertical` orientations. Disabled tabs are skipped.

### Rules

| Rule | Strength | Verified by |
| - | - | - |
| Set `controls` on each `bq-tab` to the `id` of its panel | MUST | manual: compare each tab controls value with its panel id |
| Add `role="tabpanel"` and the matching `id` to each panel element | MUST | manual: inspect panel roles and ids in the DOM |
| Add an `aria-label` to the `bq-tab` when it uses an icon without a visible label | MUST | manual: inspect icon-only tab accessible names |

## API reference

### `bq-tab-group`

#### Properties

| Property | Attribute | Description | Type | Default |
| - | - | - | - | - |
| `debounceTime` | `debounce-time` | Delay in milliseconds before `bqChange` fires. With `0`, `bqChange` is emitted synchronously | `number` | `0` |
| `disableDivider` | `disable-divider` | If true, the underline divider is hidden | `boolean` | `false` |
| `orientation` | `orientation` | Layout direction of the tab list | `"horizontal" \| "vertical"` | `"horizontal"` |
| `placement` | `placement` | Alignment of tabs within the group | `"start" \| "end"` | `"start"` |
| `size` | `size` | Size applied to all child tabs | `"small" \| "medium" \| "large"` | `"medium"` |
| `value` | `value` | The `tab-id` of the currently selected tab | `string` | — |

#### Invalid combinations

| Combination | Strength | Result |
| - | - | - |
| `size`, `orientation` or `placement` on a `bq-tab` inside `bq-tab-group` | SHOULD NOT | The group overwrites these values on every tab |

#### Events

| Event | Description | Type |
| - | - | - |
| `bqChange` | Fired when the selected tab changes | `CustomEvent<{ target: HTMLBqTabElement; value: string }>` |

#### Slots

| Slot | Description |
| - | - |
| *(default)* | The `bq-tab` items to render inside the group |

#### Shadow parts

| Part | Description |
| - | - |
| `base` | The outer `<div>` wrapper |
| `tabs` | The `<div role="tablist">` holding all tab buttons |

#### CSS custom properties

| Variable | Description | Default |
| - | - | - |
| `--bq-tab-group--border-color` | Color of the divider line along the tabs | `var(--bq-stroke--primary)` |

***

### `bq-tab`

#### Properties

| Property | Attribute | Description | Type | Default |
| - | - | - | - | - |
| `active` | `active` | If true, the tab is rendered in its active state | `boolean` | — |
| `controls` *(required)* | `controls` | The `id` of the panel element this tab controls | `string` | — |
| `disabled` | `disabled` | If true, the tab is non-interactive | `boolean` | `false` |
| `orientation` | `orientation` | Layout direction — propagated automatically by `bq-tab-group` | `"horizontal" \| "vertical"` | `"horizontal"` |
| `placement` | `placement` | Alignment — propagated automatically by `bq-tab-group` | `"start" \| "end"` | `"start"` |
| `size` | `size` | Size — propagated automatically by `bq-tab-group` | `"small" \| "medium" \| "large"` | `"medium"` |
| `tabId` *(required)* | `tab-id` | Unique identifier of the tab, matched against the `value` of `bq-tab-group` to set the active tab | `string` | — |

#### Events

| Event | Description | Type |
| - | - | - |
| `bqClick` | Fired when the tab is clicked or activated | `CustomEvent<HTMLBqTabElement>` |
| `bqFocus` | Fired when the tab receives focus | `CustomEvent<HTMLBqTabElement>` |
| `bqBlur` | Fired when the tab loses focus | `CustomEvent<HTMLBqTabElement>` |
| `bqKeyDown` | Fired when a key is pressed while the tab is focused | `CustomEvent<KeyboardEvent>` |

#### Methods

| Method | Description | Signature |
| - | - | - |
| `vClick()` | Simulates a click on the underlying `<button>` element | `vClick() => Promise<void>` |
| `vFocus()` | Sets focus on the underlying `<button>` element | `vFocus() => Promise<void>` |
| `vBlur()` | Removes focus from the underlying `<button>` element | `vBlur() => Promise<void>` |

#### Slots

| Slot | Description |
| - | - |
| *(default)* | The tab label text |
| `icon` | An optional icon to display before the label |

#### Shadow parts

| Part | Description |
| - | - |
| `base` | The `<button>` element |
| `content` | The `<div>` wrapping the icon and text |
| `icon` | The `<div>` holding the slotted icon |
| `text` | The `<div>` holding the slotted label text |

#### CSS custom properties

**CSS variables**

| Variable | Description | Default |
| - | - | - |
| `--bq-tab--background-hover` | Base colour of the hover state background (mixed with `--bq-hover`) | `var(--bq-ui--primary)` |
| `--bq-tab--indicator-color` | Color of the active tab indicator | `var(--bq-ui--brand)` |
| `--bq-tab--text-color` | Text color of the tab label | `var(--bq-text--primary)` |
| `--bq-tab--text-color-active` | Text color of the active tab label | `var(--bq-text--brand)` |
| `--bq-tab--text-color-hover` | Base colour of the hover state text (mixed with `--bq-hover`) | `var(--bq-text--brand)` |
| `--bq-tab--font-size` | Font size of the tab label | `var(--bq-font-size--m)` |
| `--bq-tab--font-weight` | Font weight of the tab label | `var(--bq-font-weight--medium)` |
| `--bq-tab--line-height` | Line height of the tab label | `var(--bq-font-line-height--regular)` |
| `--bq-tab--label-icon-gap` | Gap between the icon and the label | `var(--bq-spacing-xs)` |
| `--bq-tab--padding-vertical-small` | Vertical padding for the small size | `var(--bq-spacing-xs2)` |
| `--bq-tab--padding-horizontal-small` | Horizontal padding for the small size | `var(--bq-spacing-m)` |
| `--bq-tab--padding-vertical-medium` | Vertical padding for the medium size | `var(--bq-spacing-xs)` |
| `--bq-tab--padding-horizontal-medium` | Horizontal padding for the medium size | `var(--bq-spacing-l)` |
| `--bq-tab--padding-vertical-large` | Vertical padding for the large size | `var(--bq-spacing-s)` |
| `--bq-tab--padding-horizontal-large` | Horizontal padding for the large size | `var(--bq-spacing-l)` |
| `--bq-tab--icon-size-small` | Icon size for the small variant | `20px` |
| `--bq-tab--icon-size-medium` | Icon size for the medium variant | `24px` |
| `--bq-tab--icon-size-large` | Icon size for the large variant | `24px` |

> [!TIP]
>
> Learn more about [styling with shadow parts](https://www.beeq.design/guides/styles.md) and [CSS custom properties](https://www.beeq.design/theming/global-css-variables.md).

## Resources

> [card] [Interactive playground](https://storybook.beeq.design/?path=/story/components-tabs--default)
>
> Explore Tab variants and states in Storybook

> [card] [Source code](https://github.com/Endava/BEEQ/tree/main/packages/beeq/src/components/tab)
>
> View the component source on GitHub


## Related topics

- [Table](https://www.beeq.design/components/table.md)
- [Checkbox](https://www.beeq.design/components/checkbox.md)
- [Tooltip](https://www.beeq.design/components/tooltip.md)
- [Drawer](https://www.beeq.design/components/drawer.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.