> ## 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.

# Select

> Select lets users choose one or more options from a predefined list, with a styled trigger, a floating option panel, and native form support.

![BEEQ Select component overview](https://mintcdn.com/beeq/2Zl7C9Zhms1pGHN9/components/images/select/select-overview-light.svg?fit=max\&auto=format\&n=2Zl7C9Zhms1pGHN9\&q=85\&s=31a2efaa291f9d2e6ab017bac8f49565)

Select component overview

The select input lets users choose one option — or multiple options when `multiple` is enabled — from a predefined list. It pairs a styled trigger with a floating panel of `bq-option` elements and integrates with native HTML forms.

## When to use

> [card]
>
> Use Select when
>
> * The option list contains more than five items and a radio group would take too much space
> * Users need to choose from a predefined set of values in a form
> * Multiple selection from a long list is required and a checkbox group would be impractical
> * The available choices are dynamic or loaded from an external source

> [card]
>
> Do not use Select when
>
> * Fewer than five options are available — use radio buttons or a segmented control instead
> * The user needs to type a free-form value not constrained to a fixed list — use an [Input](https://www.beeq.design/components/input.md) instead
> * The choices are binary (yes / no, on / off) — use a [Checkbox](https://www.beeq.design/components/checkbox.md) or toggle instead

> [!TIP]
>
> Use `bq-select` when the chosen value needs form submission or validation. Choose [`bq-radio-group`](https://www.beeq.design/components/radio) when a few named choices can stay visible, and [`bq-dropdown`](https://www.beeq.design/components/dropdown) when the options trigger actions or lead to destinations instead of setting a form value.

## Patterns

> [card] Single select
>
> Single Select allows the user to pick one option from a menu.

> [card] Multiple select
>
> Multiple Select supports independent choices. Add `enable-checkboxes` when checkboxes make the multi-select state easier to scan. Selected items appear as dismissible tags in the input.

> [card] Nested multiple select
>
> Use nested options for selectable categories and their related choices. Parents cascade selection to their selectable descendants and show a mixed state when only some descendants are selected.

## Anatomy

![BEEQ Select component anatomy](https://mintcdn.com/beeq/2Zl7C9Zhms1pGHN9/components/images/select/select-anatomy-light.svg?fit=max\&auto=format\&n=2Zl7C9Zhms1pGHN9\&q=85\&s=020c04d9fc18535c9c25dbec8fd6808e)

Select component anatomy

The select is composed of a label, an input field, a dropdown panel, and optional status indicators.

| Part | Element | Description |
| - | - | - |
| **1** | Label | The descriptive label rendered above the input control. It can include an optional info icon for additional context and optional/required indicator |
| **2** | Input field | The control area that displays the selected value or placeholder |
| **3** | Placeholder | The hint text shown inside the input when no value is selected |
| **4** | Leading icon | Optional prefix icon displayed at the start of the input field |
| **5** | Helper text (optional) | Helper text below the input providing guidance or validation feedback |
| **6** | Dropdown icon | The chevron caret at the end of the input that indicates the open/closed state |
| **7** | Dropdown panel | The floating container that opens below the input and holds the option list |
| **8** | Menu | The list of selectable `bq-option` items inside the dropdown panel |
| **9** | Scroll | The scrollbar that appears when the option list overflows the panel height |

## Design guidelines

### Single vs. multiple selection

![Single selection](https://www.beeq.design/components/images/select/select-single-light.svg)
![Single selection](https://www.beeq.design/components/images/select/select-single-dark.svg)

## Single selection

The default mode. Users pick exactly one option; the selected value replaces the placeholder text in the input.

![Multiple selection](https://www.beeq.design/components/images/select/select-multiple-light.svg)
![Multiple selection](https://www.beeq.design/components/images/select/select-multiple-dark.svg)

## Multiple selection

Enable with `multiple`. Selected items appear as removable tags inside the input. Use `max-tags-visible` to cap how many tags show before a `+N` overflow tag appears.

### Nested multiple selection

Use nested options when people need to select a category, its related choices, or both. Nesting is available only with `multiple`; single selects render only top-level options and log a browser warning when nested markup is present.

* Nested multi-select always renders checkboxes. You do not need `enable-checkboxes`.
* Selecting a parent selects its selectable descendants. Selecting a child also selects its selectable ancestors.
* A parent becomes indeterminate while only some of its selectable descendants are selected. Disabled and hidden descendants are not changed by a cascade.
* Use a unique `value` for every option in the tree. Duplicate values are reported in the browser console because they make the value and event payload ambiguous.

In the input, nested selections render one tag per selected top-level parent. A partial selection adds the descendant count, such as `Frontend (2)`; a fully selected branch keeps the parent label without a count.

### Validation states

![Error state](https://www.beeq.design/components/images/select/select-error-light.svg)
![Error state](https://www.beeq.design/components/images/select/select-error-dark.svg)

## Error state

Set `validation-status="error"` and populate the `helper-text` slot with the reason. Always pair a visual indicator with a text description so color-blind users are not excluded.

![Success state](https://www.beeq.design/components/images/select/select-success-light.svg)
![Success state](https://www.beeq.design/components/images/select/select-success-dark.svg)

## Success state

Set `validation-status="success"` to confirm a valid selection. Use sparingly — only when confirmation meaningfully reduces user uncertainty.

## Usage

### Default

Enhance user interaction by implementing the default select variant. Perfect for scenarios where you want users to choose from a list of options within a dropdown.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select placeholder="Placeholder">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

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

<BqSelect placeholder="Placeholder">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  template: `
    <bq-select placeholder="Placeholder">
      <label slot="label">Select label</label>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<template>
  <BqSelect placeholder="Placeholder">
    <label slot="label">Select label</label>
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>

<script setup>
import { BqIcon, BqOption, BqSelect } from "@beeq/vue";
</script>
```

### Open

Use the `open` attribute to display the select dropdown by default, offering users quick access to the available options without additional clicks. Use `autofocus` to keep the input focused on render.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select autofocus open placeholder="Placeholder">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

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

<BqSelect autofocus open placeholder="Placeholder">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  template: `
    <bq-select autofocus open placeholder="Placeholder">
      <label slot="label">Select label</label>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<template>
  <BqSelect autofocus open placeholder="Placeholder">
    <label slot="label">Select label</label>
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>

<script setup>
import { BqIcon, BqOption, BqSelect } from "@beeq/vue";
</script>
```

### Initial value

Set an initial `value` for the select component to preselect an option, providing a streamlined user experience and minimizing manual input.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select placeholder="Placeholder" value="2">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

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

<BqSelect placeholder="Placeholder" value="2">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  template: `
    <bq-select placeholder="Placeholder" value="2">
      <label slot="label">Select label</label>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<template>
  <BqSelect placeholder="Placeholder" value="2">
    <label slot="label">Select label</label>
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>

<script setup>
import { BqIcon, BqOption, BqSelect } from "@beeq/vue";
</script>
```

### Display value

The `displayValue` property (`display-value` attribute) on `bq-option` overrides the value shown inside the input after selection. Use it when the full option content (e.g., multi-line layout) should not be collapsed into the input field.

```css styles.css icon="css" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
.payment-option {
  display: flex;
  flex-direction: column;
  gap: var(--bq-spacing-xs2);
}

.payment-option__header {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}

.payment-option__name {
  font-weight: 600;
}

.payment-option__meta,
.payment-option__owner {
  padding-inline-start: 28px;
  color: var(--bq-text--secondary);
}

.payment-option__meta {
  font-size: var(--bq-font-size--s);
}

.payment-option__owner {
  font-size: var(--bq-font-size--xs);
}
```

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select placeholder="Payment method..." open>
  <label slot="label">Choose a payment method</label>
  <span slot="helper-text">
    You will not be charged until you review your order on the next page
  </span>
  <bq-option value="visa-1234" display-value="Visa •••• 1234">
    <div class="payment-option">
      <div class="payment-option__header">
        <bq-icon name="credit-card" size="20"></bq-icon>
        <span class="payment-option__name">Visa ending in 1234</span>
      </div>
      <span class="payment-option__meta">Expires 12/2025</span>
      <span class="payment-option__owner">John Doe</span>
    </div>
  </bq-option>
  <bq-option value="mastercard-5678" display-value="Mastercard •••• 5678">
    <div class="payment-option">
      <div class="payment-option__header">
        <bq-icon name="credit-card" size="20"></bq-icon>
        <span class="payment-option__name">Mastercard ending in 5678</span>
      </div>
      <span class="payment-option__meta">Expires 08/2026</span>
      <span class="payment-option__owner">Jane Smith</span>
    </div>
  </bq-option>
  <bq-option value="paypal" display-value="PayPal">
    <div class="payment-option">
      <div class="payment-option__header">
        <bq-icon name="paypal-logo" size="20"></bq-icon>
        <span class="payment-option__name">Pay with PayPal</span>
      </div>
      <span class="payment-option__meta">john.doe@email.com</span>
    </div>
  </bq-option>
</bq-select>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqIcon, BqOption, BqSelect } from "@beeq/react";
import "./styles.css";

<BqSelect placeholder="Payment method..." open>
  <label slot="label">Choose a payment method</label>
  <span slot="helper-text">
    You will not be charged until you review your order on the next page
  </span>
  <BqOption value="visa-1234" displayValue="Visa •••• 1234">
    <div className="payment-option">
      <div className="payment-option__header">
        <BqIcon name="credit-card" size="20" />
        <span className="payment-option__name">Visa ending in 1234</span>
      </div>
      <span className="payment-option__meta">Expires 12/2025</span>
      <span className="payment-option__owner">John Doe</span>
    </div>
  </BqOption>
  <BqOption value="mastercard-5678" displayValue="Mastercard •••• 5678">
    <div className="payment-option">
      <div className="payment-option__header">
        <BqIcon name="credit-card" size="20" />
        <span className="payment-option__name">Mastercard ending in 5678</span>
      </div>
      <span className="payment-option__meta">Expires 08/2026</span>
      <span className="payment-option__owner">Jane Smith</span>
    </div>
  </BqOption>
  <BqOption value="paypal" displayValue="PayPal">
    <div className="payment-option">
      <div className="payment-option__header">
        <BqIcon name="paypal-logo" size="20" />
        <span className="payment-option__name">Pay with PayPal</span>
      </div>
      <span className="payment-option__meta">john.doe@email.com</span>
    </div>
  </BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  template: `
    <bq-select placeholder="Payment method..." open>
      <label slot="label">Choose a payment method</label>
      <span slot="helper-text">
        You will not be charged until you review your order on the next page
      </span>
      <bq-option value="visa-1234" display-value="Visa •••• 1234">
        <div class="payment-option">
          <div class="payment-option__header">
            <bq-icon name="credit-card" size="20"></bq-icon>
            <span class="payment-option__name">Visa ending in 1234</span>
          </div>
          <span class="payment-option__meta">Expires 12/2025</span>
          <span class="payment-option__owner">John Doe</span>
        </div>
      </bq-option>
      <bq-option value="mastercard-5678" display-value="Mastercard •••• 5678">
        <div class="payment-option">
          <div class="payment-option__header">
            <bq-icon name="credit-card" size="20"></bq-icon>
            <span class="payment-option__name">Mastercard ending in 5678</span>
          </div>
          <span class="payment-option__meta">Expires 08/2026</span>
          <span class="payment-option__owner">Jane Smith</span>
        </div>
      </bq-option>
      <bq-option value="paypal" display-value="PayPal">
        <div class="payment-option">
          <div class="payment-option__header">
            <bq-icon name="paypal-logo" size="20"></bq-icon>
            <span class="payment-option__name">Pay with PayPal</span>
          </div>
          <span class="payment-option__meta">john.doe@email.com</span>
        </div>
      </bq-option>
    </bq-select>
  `,
  styles: [`
    .payment-option {
      display: flex;
      flex-direction: column;
      gap: var(--bq-spacing-xs2);
    }

    .payment-option__header {
      display: flex;
      align-items: center;
      gap: var(--bq-spacing-xs);
    }

    .payment-option__name {
      font-weight: 600;
    }

    .payment-option__meta,
    .payment-option__owner {
      padding-inline-start: 28px;
      color: var(--bq-text--secondary);
    }

    .payment-option__meta {
      font-size: var(--bq-font-size--s);
    }

    .payment-option__owner {
      font-size: var(--bq-font-size--xs);
    }
  `],
})
export class AppComponent {}
```

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

<template>
  <BqSelect placeholder="Payment method..." open>
    <label slot="label">Choose a payment method</label>
    <span slot="helper-text">
      You will not be charged until you review your order on the next page
    </span>
    <BqOption value="visa-1234" displayValue="Visa •••• 1234">
      <div class="payment-option">
        <div class="payment-option__header">
          <BqIcon name="credit-card" size="20" />
          <span class="payment-option__name">Visa ending in 1234</span>
        </div>
        <span class="payment-option__meta">Expires 12/2025</span>
        <span class="payment-option__owner">John Doe</span>
      </div>
    </BqOption>
    <BqOption value="mastercard-5678" displayValue="Mastercard •••• 5678">
      <div class="payment-option">
        <div class="payment-option__header">
          <BqIcon name="credit-card" size="20" />
          <span class="payment-option__name">Mastercard ending in 5678</span>
        </div>
        <span class="payment-option__meta">Expires 08/2026</span>
        <span class="payment-option__owner">Jane Smith</span>
      </div>
    </BqOption>
    <BqOption value="paypal" displayValue="PayPal">
      <div class="payment-option">
        <div class="payment-option__header">
          <BqIcon name="paypal-logo" size="20" />
          <span class="payment-option__name">Pay with PayPal</span>
        </div>
        <span class="payment-option__meta">john.doe@email.com</span>
      </div>
    </BqOption>
  </BqSelect>
</template>

<style>
  .payment-option {
    display: flex;
    flex-direction: column;
    gap: var(--bq-spacing-xs2);
  }

  .payment-option__header {
    display: flex;
    align-items: center;
    gap: var(--bq-spacing-xs);
  }

  .payment-option__name {
    font-weight: 600;
  }

  .payment-option__meta,
  .payment-option__owner {
    padding-inline-start: 28px;
    color: var(--bq-text--secondary);
  }

  .payment-option__meta {
    font-size: var(--bq-font-size--s);
  }

  .payment-option__owner {
    font-size: var(--bq-font-size--xs);
  }
</style>
```

### Disabled

Employ the `disabled` attribute to restrict user interaction with the select component temporarily, useful for scenarios where certain options are unavailable.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select disabled placeholder="Placeholder" value="3">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

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

<BqSelect disabled placeholder="Placeholder" value="3">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  template: `
    <bq-select disabled placeholder="Placeholder" value="3">
      <label slot="label">Select label</label>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<template>
  <BqSelect disabled placeholder="Placeholder" value="3">
    <label slot="label">Select label</label>
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>

<script setup>
import { BqIcon, BqOption, BqSelect } from "@beeq/vue";
</script>
```

### Multiple

Use `multiple` to enable multiple selections. Add `enable-checkboxes` for a flat list when visible checkboxes make the current selections easier to scan. Use `keep-open-on-select` to keep the panel open while the user selects options. The `max-tags-visible` attribute controls how many tags are shown before a `+N` overflow tag appears.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select
  multiple
  enable-checkboxes
  keep-open-on-select
  max-tags-visible="2"
  placeholder="Placeholder"
  value='["running","biking","pizza"]'
>
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="running">
    <bq-icon slot="prefix" name="sneaker-move"></bq-icon>
    Running
  </bq-option>
  <bq-option value="hiking">
    <bq-icon slot="prefix" name="boot"></bq-icon>
    Hiking
  </bq-option>
  <bq-option value="biking">
    <bq-icon slot="prefix" name="person-simple-bike"></bq-icon>
    Biking
  </bq-option>
  <bq-option value="swimming">
    <bq-icon slot="prefix" name="swimming-pool"></bq-icon>
    Swimming
  </bq-option>
  <bq-option value="pizza">
    <bq-icon slot="prefix" name="pizza"></bq-icon>
    Pizza
  </bq-option>
  <bq-option value="hamburger">
    <bq-icon slot="prefix" name="hamburger"></bq-icon>
    Hamburger
  </bq-option>
</bq-select>
```

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

<BqSelect
  multiple
  enableCheckboxes
  keepOpenOnSelect
  maxTagsVisible={2}
  placeholder="Placeholder"
  value={["running", "biking", "pizza"]}
>
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="running">
    <BqIcon slot="prefix" name="sneaker-move" />
    Running
  </BqOption>
  <BqOption value="hiking">
    <BqIcon slot="prefix" name="boot" />
    Hiking
  </BqOption>
  <BqOption value="biking">
    <BqIcon slot="prefix" name="person-simple-bike" />
    Biking
  </BqOption>
  <BqOption value="swimming">
    <BqIcon slot="prefix" name="swimming-pool" />
    Swimming
  </BqOption>
  <BqOption value="pizza">
    <BqIcon slot="prefix" name="pizza" />
    Pizza
  </BqOption>
  <BqOption value="hamburger">
    <BqIcon slot="prefix" name="hamburger" />
    Hamburger
  </BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  template: `
    <bq-select
      multiple
      enable-checkboxes
      keep-open-on-select
      max-tags-visible="2"
      placeholder="Placeholder"
      value='["running","biking","pizza"]'
    >
      <label slot="label">Select label</label>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="running">
        <bq-icon slot="prefix" name="sneaker-move"></bq-icon>
        Running
      </bq-option>
      <bq-option value="hiking">
        <bq-icon slot="prefix" name="boot"></bq-icon>
        Hiking
      </bq-option>
      <bq-option value="biking">
        <bq-icon slot="prefix" name="person-simple-bike"></bq-icon>
        Biking
      </bq-option>
      <bq-option value="swimming">
        <bq-icon slot="prefix" name="swimming-pool"></bq-icon>
        Swimming
      </bq-option>
      <bq-option value="pizza">
        <bq-icon slot="prefix" name="pizza"></bq-icon>
        Pizza
      </bq-option>
      <bq-option value="hamburger">
        <bq-icon slot="prefix" name="hamburger"></bq-icon>
        Hamburger
      </bq-option>
    </bq-select>
  `
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<template>
  <BqSelect
    multiple
    enableCheckboxes
    keepOpenOnSelect
    :maxTagsVisible="2"
    placeholder="Placeholder"
    :value="['running', 'biking', 'pizza']"
  >
    <label slot="label">Select label</label>
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="running">
      <BqIcon slot="prefix" name="sneaker-move" />
      Running
    </BqOption>
    <BqOption value="hiking">
      <BqIcon slot="prefix" name="boot" />
      Hiking
    </BqOption>
    <BqOption value="biking">
      <BqIcon slot="prefix" name="person-simple-bike" />
      Biking
    </BqOption>
    <BqOption value="swimming">
      <BqIcon slot="prefix" name="swimming-pool" />
      Swimming
    </BqOption>
    <BqOption value="pizza">
      <BqIcon slot="prefix" name="pizza" />
      Pizza
    </BqOption>
    <BqOption value="hamburger">
      <BqIcon slot="prefix" name="hamburger" />
      Hamburger
    </BqOption>
  </BqSelect>
</template>

<script setup>
import { BqIcon, BqOption, BqSelect } from "@beeq/vue";
</script>
```

### Nested options

Nested options are a multiple-select pattern. Put child options in their parent’s `options` slot and give every option a unique value. The parent below starts expanded with one selected child, so its checkbox is indeterminate and its tag shows the selected descendant count.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select
  multiple
  keep-open-on-select
  placeholder="Choose skills"
  value='["frontend","frontend:react", "backend", "backend:node"]'
>
  <label slot="label">Skills</label>
  <bq-option
    all-selected-label="All skills"
    expanded
    selected-count-label="{count} skills selected"
    value="frontend"
  >
    Frontend
    <span slot="expand-label">2 levels</span>
    <bq-option slot="options" value="frontend:react">React</bq-option>
    <bq-option slot="options" value="frontend:vue">Vue</bq-option>
  </bq-option>
  <bq-option value="backend">
    Backend
    <span slot="expand-label">2 levels</span>
    <bq-option slot="options" value="backend:node">Node.js</bq-option>
    <bq-option slot="options" value="backend:dotnet">.NET</bq-option>
  </bq-option>
</bq-select>
```

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

<BqSelect
  multiple
  keepOpenOnSelect
  placeholder="Choose skills"
  value={["frontend","frontend:react", "backend", "backend:node"]}
>
  <label slot="label">Skills</label>
  <BqOption
    allSelectedLabel="All skills"
    expanded
    selectedCountLabel="{count} skills selected"
    value="frontend"
  >
    Frontend
    <span slot="expand-label">2 levels</span>
    <BqOption slot="options" value="frontend:react">React</BqOption>
    <BqOption slot="options" value="frontend:vue">Vue</BqOption>
  </BqOption>
  <BqOption value="backend">
    Backend
    <span slot="expand-label">2 levels</span>
    <BqOption slot="options" value="backend:node">Node.js</BqOption>
    <BqOption slot="options" value="backend:dotnet">.NET</BqOption>
  </BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqOption, BqSelect],
  template: `
    <bq-select
      multiple
      keep-open-on-select
      placeholder="Choose skills"
      value='["frontend","frontend:react", "backend", "backend:node"]'
    >
      <label slot="label">Skills</label>
      <bq-option
        all-selected-label="All skills"
        expanded
        selected-count-label="{count} skills selected"
        value="frontend"
      >
        Frontend
        <span slot="expand-label">2 levels</span>
        <bq-option slot="options" value="frontend:react">React</bq-option>
        <bq-option slot="options" value="frontend:vue">Vue</bq-option>
      </bq-option>
      <bq-option value="backend">
        Backend
        <span slot="expand-label">2 levels</span>
        <bq-option slot="options" value="backend:node">Node.js</bq-option>
        <bq-option slot="options" value="backend:dotnet">.NET</bq-option>
      </bq-option>
    </bq-select>
  `,
})
export class NestedSelectComponent {}
```

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

<template>
  <BqSelect
    multiple
    keepOpenOnSelect
    placeholder="Choose skills"
    :value="['frontend','frontend:react', 'backend', 'backend:node']"
  >
    <label slot="label">Skills</label>
    <BqOption
      allSelectedLabel="All skills"
      expanded
      selectedCountLabel="{count} skills selected"
      value="frontend"
    >
      Frontend
      <span slot="expand-label">2 levels</span>
      <BqOption slot="options" value="frontend:react">React</BqOption>
      <BqOption slot="options" value="frontend:vue">Vue</BqOption>
    </BqOption>
    <BqOption value="backend">
      Backend
      <span slot="expand-label">2 levels</span>
      <BqOption slot="options" value="backend:node">Node.js</BqOption>
      <BqOption slot="options" value="backend:dotnet">.NET</BqOption>
    </BqOption>
  </BqSelect>
</template>
```

#### Set a fully selected branch

Use `value` to set and control the Select's state. It stays a flat array, even when the options are nested.

**1. Add the parent value**

Include `"frontend"` when the Frontend parent is selected.

**2. Add every selectable descendant**

Include `"frontend:react"` and `"frontend:vue"` to mark the whole Frontend branch as selected.

The component keeps the parent tag as `Frontend` and shows the `all-selected-label` summary in the open list.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select
  multiple
  value='["frontend","frontend:react","frontend:vue"]'
>
  <bq-option expanded value="frontend">
    Frontend
    <bq-option slot="options" value="frontend:react">React</bq-option>
    <bq-option slot="options" value="frontend:vue">Vue</bq-option>
  </bq-option>
</bq-select>
```

> [!WARNING]
>
> `selectionTree` is event output, not component input. Do not pass it back into `value`.

> [!TIP]
>
> Set `show-selection-summary="false"` on a parent option when the visual summary beside its expand control is not useful in your context.

#### Read a nested selection event

Listen for `bqSelect` when the selection changes. The event gives you two views of the same state:

| If you need to… | Use | Why |
| - | - | - |
| Set the Select value, reset it, submit a form, or call a flat API | `event.detail.value` | This is the canonical flat `string[]` used by the component. |
| Send selected categories and children to a hierarchy-aware API | `event.detail.selectionTree` | This is a selected-only tree, built from the current `value`. |

> [!NOTE]
>
> `selectionTree` exists only for nested multi-select. It is `undefined` for flat and single Selects. Treat it as read-only output; keep using `value` to control the component.

```javascript theme={"theme":{"light":"one-light","dark":"night-owl"}}
const skillsSelect = document.querySelector('bq-select');

skillsSelect?.addEventListener('bqSelect', (event) => {
  const { value, selectionTree } = event.detail;

  saveFormState(value);
  if (selectionTree) sendCategoryPayload(selectionTree);
});
```

For example, `event.detail.selectionTree` looks like this after selecting the full Frontend branch and Node.js:

```json theme={"theme":{"light":"one-light","dark":"night-owl"}}
[
  {
    "value": "frontend",
    "children": [
      { "value": "frontend:react", "children": [] },
      { "value": "frontend:vue", "children": [] }
    ]
  },
  {
    "value": "backend",
    "children": [
      { "value": "backend:node", "children": [] }
    ]
  }
]
```

## Options

| Dimension | Attribute | Allowed values | Default |
| - | - | - | - |
| Validation status | `validation-status` | `error`, `none`, `success`, `warning` | `none` |
| Panel placement | `placement` | `bottom`, `bottom-end`, `bottom-start`, `left`, `left-end`, `left-start`, `right`, `right-end`, `right-start`, `top`, `top-end`, `top-start` | `bottom` |
| Panel position strategy | `strategy` | `absolute`, `fixed` | `fixed` |

### Prefix

Use the `prefix` slot to include additional visual elements or context, such as an icon, to provide users with extra visual cues about the field's purpose.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select placeholder="Placeholder">
  <label slot="label">Select label</label>
  <bq-icon name="user-circle" slot="prefix"></bq-icon>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

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

<BqSelect placeholder="Placeholder">
  <label slot="label">Select label</label>
  <BqIcon name="user-circle" slot="prefix" />
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  template: `
    <bq-select placeholder="Placeholder">
      <label slot="label">Select label</label>
      <bq-icon name="user-circle" slot="prefix"></bq-icon>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<template>
  <BqSelect placeholder="Placeholder">
    <label slot="label">Select label</label>
    <BqIcon name="user-circle" slot="prefix" />
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>

<script setup>
import { BqIcon, BqOption, BqSelect } from "@beeq/vue";
</script>
```

### Suffix

Leverage the `suffix` slot to enhance the select component with extra elements. The default suffix is a rotating chevron caret; replace it with any icon to match your design context.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select placeholder="Placeholder">
  <label slot="label">Select label</label>
  <bq-icon name="arrow-down" slot="suffix"></bq-icon>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

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

<BqSelect placeholder="Placeholder">
  <label slot="label">Select label</label>
  <BqIcon name="arrow-down" slot="suffix" />
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  template: `
    <bq-select placeholder="Placeholder">
      <label slot="label">Select label</label>
      <bq-icon name="arrow-down" slot="suffix"></bq-icon>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<template>
  <BqSelect placeholder="Placeholder">
    <label slot="label">Select label</label>
    <BqIcon name="arrow-down" slot="suffix" />
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>

<script setup>
import { BqIcon, BqOption, BqSelect } from "@beeq/vue";
</script>
```

### Validation

Use `validation-status` to signal the validation state (`error`, `warning`, or `success`) of the select component, ensuring accurate data input and real-time feedback.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select placeholder="Placeholder" validation-status="error" value="1">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>

<bq-select placeholder="Placeholder" validation-status="warning" value="2">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>

<bq-select placeholder="Placeholder" validation-status="success" value="3">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

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

<BqSelect placeholder="Placeholder" validationStatus="error" value="1">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>

<BqSelect placeholder="Placeholder" validationStatus="warning" value="2">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>

<BqSelect placeholder="Placeholder" validationStatus="success" value="3">
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  template: `
    <bq-select placeholder="Placeholder" validation-status="error" value="1">
      <label slot="label">Select label</label>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>

    <bq-select placeholder="Placeholder" validation-status="warning" value="2">
      <label slot="label">Select label</label>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>

    <bq-select placeholder="Placeholder" validation-status="success" value="3">
      <label slot="label">Select label</label>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `
})
export class AppComponent {}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<template>
  <BqSelect placeholder="Placeholder" validationStatus="error" value="1">
    <label slot="label">Select label</label>
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>

  <BqSelect placeholder="Placeholder" validationStatus="warning" value="2">
    <label slot="label">Select label</label>
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>

  <BqSelect placeholder="Placeholder" validationStatus="success" value="3">
    <label slot="label">Select label</label>
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>

<script setup>
import { BqIcon, BqOption, BqSelect } from "@beeq/vue";
</script>
```

### Label with "Optional"

Choose this style when you want to include an optional label for additional context, providing users with guidance while maintaining a clean and unobtrusive design.

```css styles.css icon="css" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
[slot="label"] {
  display: flex;
  flex: 1 1 0%;
}

[slot="label"] > label {
  display: flex;
  flex-grow: 1;
  align-items: center;
}

[slot="label"] > span {
  color: var(--bq-text--secondary);
}

span[slot="helper-text"] {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
```

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select placeholder="Placeholder">
  <div slot="label">
    <label>Select label</label>
    <span>Optional</span>
  </div>
  <bq-icon name="user-circle" slot="prefix"></bq-icon>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqIcon, BqOption, BqSelect } from "@beeq/react";
import "./styles.css";

<BqSelect placeholder="Placeholder">
  <div slot="label">
    <label>Select label</label>
    <span>Optional</span>
  </div>
  <BqIcon name="user-circle" slot="prefix" />
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  template: `
    <bq-select placeholder="Placeholder">
      <div slot="label">
        <label>Select label</label>
        <span>Optional</span>
      </div>
      <bq-icon name="user-circle" slot="prefix"></bq-icon>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `,
  styles: [`
    [slot="label"] {
      display: flex;
      flex: 1 1 0%;
    }

    [slot="label"] > label {
      display: flex;
      flex-grow: 1;
      align-items: center;
    }

    [slot="label"] > span {
      color: var(--bq-text--secondary);
    }

    span[slot="helper-text"] {
      display: flex;
      align-items: center;
      gap: var(--bq-spacing-xs);
    }
  `]
})
export class AppComponent {}
```

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

<template>
  <BqSelect placeholder="Placeholder">
    <div slot="label">
      <label>Select label</label>
      <span>Optional</span>
    </div>
    <BqIcon name="user-circle" slot="prefix" />
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>

<style>
  [slot="label"] {
    display: flex;
    flex: 1 1 0%;
  }

  [slot="label"] > label {
    display: flex;
    flex-grow: 1;
    align-items: center;
  }

  [slot="label"] > span {
    color: var(--bq-text--secondary);
  }

  span[slot="helper-text"] {
    display: flex;
    align-items: center;
    gap: var(--bq-spacing-xs);
  }
</style>
```

### Label with "Info Tooltip"

Enhance user understanding by incorporating a `bq-tooltip` alongside the label, offering additional information or clarification about the select.

```css styles.css icon="css" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
[slot="label"] {
  display: flex;
  flex: 1 1 0%;
}

[slot="label"] > label {
  display: flex;
  flex-grow: 1;
  align-items: center;
}

[slot="label"] > span {
  color: var(--bq-text--secondary);
}

span[slot="helper-text"] {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
```

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select placeholder="Placeholder">
  <div slot="label">
    <label>
      Select label
      <bq-tooltip>
        <bq-icon name="info" slot="trigger"></bq-icon>
        You can provide more context by adding a tooltip to the label.
      </bq-tooltip>
    </label>
    <span>Optional</span>
  </div>
  <bq-icon name="user-circle" slot="prefix"></bq-icon>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqIcon, BqOption, BqSelect, BqTooltip } from "@beeq/react";
import "./styles.css";

<BqSelect placeholder="Placeholder">
  <div slot="label">
    <label>
      Select label
      <BqTooltip>
        <BqIcon name="info" slot="trigger" />
        You can provide more context by adding a tooltip to the label.
      </BqTooltip>
    </label>
    <span>Optional</span>
  </div>
  <BqIcon name="user-circle" slot="prefix" />
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect, BqTooltip],
  template: `
    <bq-select placeholder="Placeholder">
      <div slot="label">
        <label>
          Select label
          <bq-tooltip>
            <bq-icon name="info" slot="trigger"></bq-icon>
            You can provide more context by adding a tooltip to the label.
          </bq-tooltip>
        </label>
        <span>Optional</span>
      </div>
      <bq-icon name="user-circle" slot="prefix"></bq-icon>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `,
  styles: [`
    [slot="label"] {
      display: flex;
      flex: 1 1 0%;
    }

    [slot="label"] > label {
      display: flex;
      flex-grow: 1;
      align-items: center;
    }

    [slot="label"] > span {
      color: var(--bq-text--secondary);
    }

    span[slot="helper-text"] {
      display: flex;
      align-items: center;
      gap: var(--bq-spacing-xs);
    }
  `]
})
export class AppComponent {}
```

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

<template>
  <BqSelect placeholder="Placeholder">
    <div slot="label">
      <label>
        Select label
        <BqTooltip>
          <BqIcon name="info" slot="trigger" />
          You can provide more context by adding a tooltip to the label.
        </BqTooltip>
      </label>
      <span>Optional</span>
    </div>
    <BqIcon name="user-circle" slot="prefix" />
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>

<style>
  [slot="label"] {
    display: flex;
    flex: 1 1 0%;
  }

  [slot="label"] > label {
    display: flex;
    flex-grow: 1;
    align-items: center;
  }

  [slot="label"] > span {
    color: var(--bq-text--secondary);
  }

  span[slot="helper-text"] {
    display: flex;
    align-items: center;
    gap: var(--bq-spacing-xs);
  }
</style>
```

### Panel placement

Adjust the panel placement to suit your layout. Use the `placement` attribute to position the dropdown relative to the input — useful when the select is near the bottom of the viewport.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select placeholder="Placeholder" placement="top">
  <label slot="label">
    Select label
    <bq-tooltip>
      <bq-icon name="info" slot="trigger"></bq-icon>
      You can provide more context by adding a tooltip to the label.
    </bq-tooltip>
  </label>
  <bq-icon name="user-circle" slot="prefix"></bq-icon>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqIcon, BqOption, BqSelect, BqTooltip } from "@beeq/react";

<BqSelect placeholder="Placeholder" placement="top">
  <label slot="label">
    Select label
    <BqTooltip>
      <BqIcon name="info" slot="trigger" />
      You can provide more context by adding a tooltip to the label.
    </BqTooltip>
  </label>
  <BqIcon name="user-circle" slot="prefix" />
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect, BqTooltip],
  template: `
    <bq-select placeholder="Placeholder" placement="top">
      <label slot="label">
        Select label
        <bq-tooltip>
          <bq-icon name="info" slot="trigger"></bq-icon>
          You can provide more context by adding a tooltip to the label.
        </bq-tooltip>
      </label>
      <bq-icon name="user-circle" slot="prefix"></bq-icon>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `
})
export class AppComponent {}
```

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

<template>
  <BqSelect placeholder="Placeholder" placement="top">
    <label slot="label">
      Select label
      <BqTooltip>
        <BqIcon name="info" slot="trigger" />
        You can provide more context by adding a tooltip to the label.
      </BqTooltip>
    </label>
    <BqIcon name="user-circle" slot="prefix" />
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>
```

### Visually hidden label

Keep an accessible label when the layout does not need one visibly. Use visually hidden text in the `label` slot, for example in a toolbar or compact table.

```css styles.css icon="css" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
```

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select placeholder="Placeholder">
  <span class="visually-hidden" slot="label">Choose an account</span>
  <bq-icon name="user-circle" slot="prefix"></bq-icon>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

```jsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { BqIcon, BqOption, BqSelect } from "@beeq/react";
import "./styles.css";

<BqSelect placeholder="Placeholder">
  <span className="visually-hidden" slot="label">Choose an account</span>
  <BqIcon name="user-circle" slot="prefix" />
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  styles: [`
    .visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
  `],
  template: `
    <bq-select placeholder="Placeholder">
      <span class="visually-hidden" slot="label">Choose an account</span>
      <bq-icon name="user-circle" slot="prefix"></bq-icon>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `
})
export class AppComponent {}
```

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

<template>
  <BqSelect placeholder="Placeholder">
    <span class="visually-hidden" slot="label">Choose an account</span>
    <BqIcon name="user-circle" slot="prefix" />
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>

<style>
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
</style>
```

### With no Helper Text

Select this variant when you don't need additional helper text, giving users a straightforward and uncluttered experience.

```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select placeholder="Placeholder">
  <label slot="label">Select label</label>
  <bq-icon name="user-circle" slot="prefix"></bq-icon>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

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

<BqSelect placeholder="Placeholder">
  <label slot="label">Select label</label>
  <BqIcon name="user-circle" slot="prefix" />
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  template: `
    <bq-select placeholder="Placeholder">
      <label slot="label">Select label</label>
      <bq-icon name="user-circle" slot="prefix"></bq-icon>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `
})
export class AppComponent {}
```

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

<template>
  <BqSelect placeholder="Placeholder">
    <label slot="label">Select label</label>
    <BqIcon name="user-circle" slot="prefix" />
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>
```

### Non-searchable

Set `disable-search` to keep the option panel usable while blocking any typing in the input. Users can still open the panel, browse options, and pick a value, but they cannot filter the list by typing. Use it when the option set is short enough to scan and you want to prevent free-text input from shrinking the visible options.

Keyboard focus alone keeps the panel closed. Press ArrowDown or ArrowUp to open it and move to an option.

> [!NOTE]
>
> The `readonly` attribute currently has the same effect and is now **deprecated** — use `disable-search` instead. In a future major release, `readonly` will prevent changing the selected value rather than disabling filtering.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select placeholder="Placeholder" value="2" disable-search>
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

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

<BqSelect placeholder="Placeholder" value="2" disableSearch>
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  template: `
    <bq-select placeholder="Placeholder" value="2" disable-search>
      <label slot="label">Select label</label>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `
})
export class AppComponent {}
```

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

<template>
  <BqSelect placeholder="Placeholder" value="2" disableSearch>
    <label slot="label">Select label</label>
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>
```

### Without clear button

Set `disable-clear` to hide the clear button and prevent one-click deselection. Use this when selecting a value is required and removing it should not be trivially easy.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select placeholder="Placeholder" value="1" disable-clear>
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <bq-icon name="star"></bq-icon>
    Helper text
  </span>
  <bq-option value="1">Option 1</bq-option>
  <bq-option value="2">Option 2</bq-option>
  <bq-option value="3">Option 3</bq-option>
</bq-select>
```

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

<BqSelect placeholder="Placeholder" value="1" disableClear>
  <label slot="label">Select label</label>
  <span slot="helper-text">
    <BqIcon name="star" />
    Helper text
  </span>
  <BqOption value="1">Option 1</BqOption>
  <BqOption value="2">Option 2</BqOption>
  <BqOption value="3">Option 3</BqOption>
</BqSelect>
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect],
  template: `
    <bq-select placeholder="Placeholder" value="1" disable-clear>
      <label slot="label">Select label</label>
      <span slot="helper-text">
        <bq-icon name="star"></bq-icon>
        Helper text
      </span>
      <bq-option value="1">Option 1</bq-option>
      <bq-option value="2">Option 2</bq-option>
      <bq-option value="3">Option 3</bq-option>
    </bq-select>
  `
})
export class AppComponent {}
```

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

<template>
  <BqSelect placeholder="Placeholder" value="1" disableClear>
    <label slot="label">Select label</label>
    <span slot="helper-text">
      <BqIcon name="star" />
      Helper text
    </span>
    <BqOption value="1">Option 1</BqOption>
    <BqOption value="2">Option 2</BqOption>
    <BqOption value="3">Option 3</BqOption>
  </BqSelect>
</template>
```

### Custom behavior

Call `preventDefault()` on the `bqInput` event to take full control of option filtering. This lets you implement async filtering, loading states, empty-state messages, and matched-text highlighting entirely in your own code.

Keyboard focus alone keeps the panel closed. With search enabled, typing opens it when `bqInput` is emitted: right away by default, or after `debounce-time` when you set one. Calling `preventDefault()` on that event stops automatic opening as well as built-in filtering. Set `open` yourself when your custom flow needs to show the panel.

Adding, replacing, or removing options preserves the text you are typing in both single- and multi-select. The search text is separate from `value`, which holds the committed selection. Selecting an option, clearing or resetting the field, or changing `value` programmatically replaces the search text with the selected label or an empty input.

In a searchable single-select, deleting all text or leaving only whitespace immediately clears the committed value and deselects the option. If a selection existed, this emits `bqClear`, even when your handler cancels `bqInput`. `debounce-time` delays the search event, not selection clearing. Editing a nonempty search draft keeps the previous selection; deleting a multi-select search draft keeps its selected tags.

For a controlled Select, handle `bqClear` to clear the selected value in your application or form state and reset the async query. Use the same handler for the clear button and text deletion. To show all options without removing a single selection, open the panel while keeping its selected label visible. Use `reset(select.value)` to cancel a search draft and restore that label.

For async results, keep selected options in the list when you need their labels or tags to remain visible. Ignore stale responses in your request handler so an older search does not replace newer results.

`bqFocus` and `bqBlur` track focus entering and leaving the whole Select. Moving between the input, options, and internal controls does not emit these events. Use `bqBlur` for field-level cleanup and call `reset(select.value)` to clear the search text without clearing the selection or remounting the control.

These events no longer follow input-only focus changes. If your handler needs to respond when the native input itself gains or loses focus, listen to that input's native `focus` or `blur` event instead.

> [!TIP]
>
> Set `debounce-time` to throttle how often `bqInput` fires while the user types — `300` ms is a good default for async requests.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<bq-select id="custom-select" placeholder="Search options..." debounce-time="300">
  <label slot="label">Custom filtering</label>
  <bq-option value="running" display-value="Running" data-label="Running" data-icon="sneaker-move">
    <bq-icon slot="prefix" name="sneaker-move"></bq-icon> Running
  </bq-option>
  <bq-option value="hiking" display-value="Hiking" data-label="Hiking" data-icon="boot">
    <bq-icon slot="prefix" name="boot"></bq-icon> Hiking
  </bq-option>
  <bq-option value="biking" display-value="Biking" data-label="Biking" data-icon="person-simple-bike">
    <bq-icon slot="prefix" name="person-simple-bike"></bq-icon> Biking
  </bq-option>
  <bq-option value="swimming" display-value="Swimming" data-label="Swimming" data-icon="swimming-pool">
    <bq-icon slot="prefix" name="swimming-pool"></bq-icon> Swimming
  </bq-option>
  <bq-option value="pizza" display-value="Pizza" data-label="Pizza" data-icon="pizza">
    <bq-icon slot="prefix" name="pizza"></bq-icon> Pizza
  </bq-option>
  <bq-option value="hamburger" display-value="Hamburger" data-label="Hamburger" data-icon="hamburger">
    <bq-icon slot="prefix" name="hamburger"></bq-icon> Hamburger
  </bq-option>
  <bq-option value="cookie" display-value="Cookie" data-label="Cookie" data-icon="cookie">
    <bq-icon slot="prefix" name="cookie"></bq-icon> Cookie
  </bq-option>
  <bq-option value="ice-cream" display-value="Ice-cream" data-label="Ice-cream" data-icon="ice-cream">
    <bq-icon slot="prefix" name="ice-cream"></bq-icon> Ice-cream
  </bq-option>
</bq-select>

<script>
  const select = document.querySelector('#custom-select');
  const staticOpts = Array.from(select.querySelectorAll('bq-option'));

  function removeTempOpts() {
    select.querySelectorAll('bq-option[data-temp]').forEach((opt) => opt.remove());
  }

  function insertTempOption(icon, message) {
    select.insertAdjacentHTML('beforeend',
      `<bq-option disabled data-temp="">` +
      `<bq-icon slot="prefix" name="${icon}"></bq-icon> ${message}` +
      `</bq-option>`
    );
  }

  function showAllOptions() {
    staticOpts.forEach((opt) => {
      opt.hidden = false;
      opt.innerHTML =
        `<bq-icon slot="prefix" name="${opt.getAttribute('data-icon')}"></bq-icon> ` +
        opt.getAttribute('data-label');
    });
  }

  async function fetchFilteredOptions(query) {
    await new Promise((resolve) => setTimeout(resolve, 500));
    const q = query.toLowerCase();
    return staticOpts.filter((opt) => opt.getAttribute('data-label').toLowerCase().includes(q));
  }

  select.addEventListener('bqInput', async (ev) => {
    ev.preventDefault();
    select.open = true;
    const query = ev.detail.value;

    removeTempOpts();

    if (!query) {
      showAllOptions();
      return;
    }

    staticOpts.forEach((opt) => (opt.hidden = true));
    select.insertAdjacentHTML('beforeend',
      `<bq-option disabled data-temp="">` +
      `<bq-spinner slot="prefix" animation size="small" text-position="right"></bq-spinner>` +
      ` Loading...</bq-option>`
    );

    try {
      const matches = await fetchFilteredOptions(query);
      removeTempOpts();

      if (matches.length === 0) {
        insertTempOption('x-circle', 'No results found');
      } else {
        matches.forEach((opt) => {
          opt.hidden = false;
          opt.innerHTML =
            `<bq-icon slot="prefix" name="${opt.getAttribute('data-icon')}"></bq-icon>` +
            `<span>${highlight(opt.getAttribute('data-label'), query)}</span>`;
        });
      }
    } catch (_) {
      removeTempOpts();
      insertTempOption('warning', 'Error loading options');
    }
  });

  select.addEventListener('bqSelect', () => {
    removeTempOpts();
    showAllOptions();
  });

  function highlight(text, query) {
    const escaped = query.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
    return text.replace(new RegExp(`(${escaped})`, 'gi'), '<b>$1</b>');
  }
</script>
```

```tsx React icon="react" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
import { useState } from 'react';
import type { BqSelectCustomEvent } from '@beeq/core';
import { BqIcon, BqOption, BqSelect, BqSpinner } from '@beeq/react';

const ALL_OPTIONS = [
  { label: 'Running', value: 'running', icon: 'sneaker-move', displayValue: 'Running' },
  { label: 'Hiking', value: 'hiking', icon: 'boot', displayValue: 'Hiking' },
  { label: 'Biking', value: 'biking', icon: 'person-simple-bike', displayValue: 'Biking' },
  { label: 'Swimming', value: 'swimming', icon: 'swimming-pool', displayValue: 'Swimming' },
  { label: 'Pizza', value: 'pizza', icon: 'pizza', displayValue: 'Pizza' },
  { label: 'Hamburger', value: 'hamburger', icon: 'hamburger', displayValue: 'Hamburger' },
  { label: 'Cookie', value: 'cookie', icon: 'cookie', displayValue: 'Cookie' },
  { label: 'Ice-cream', value: 'ice-cream', icon: 'ice-cream', displayValue: 'Ice-cream' },
];

function highlight(text: string, query: string) {
  const escaped = query.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
  return text.replace(new RegExp(`(${escaped})`, 'gi'), '<b>$1</b>');
}

export default function App() {
  const [visibleOptions, setVisibleOptions] = useState(ALL_OPTIONS);
  const [isLoading, setIsLoading] = useState(false);
  const [error, setError] = useState<string | null>(null);

  const handleInput = async (event: BqSelectCustomEvent<{ value: string }>) => {
    event.preventDefault();
    event.target.open = true;
    const query = event.detail.value;

    if (!query) {
      setVisibleOptions(ALL_OPTIONS);
      setError(null);
      return;
    }

    setIsLoading(true);
    setError(null);

    try {
      // Simulate an async API call
      await new Promise((resolve) => setTimeout(resolve, 300));
      const q = query.toLowerCase();
      setVisibleOptions(
        ALL_OPTIONS
          .filter((o) => o.label.toLowerCase().includes(q))
          .map((o) => ({ ...o, label: highlight(o.label, query) }))
      );
    } catch {
      setError('Error loading options');
    } finally {
      setIsLoading(false);
    }
  };

  const handleSelect = () => {
    setVisibleOptions(ALL_OPTIONS);
    setError(null);
  };

  return (
    <BqSelect
      placeholder="Search options..."
      debounceTime={300}
      onBqInput={handleInput}
      onBqSelect={handleSelect}
    >
      <label slot="label">Custom filtering</label>
      {isLoading ? (
        <BqOption disabled>
          <BqSpinner slot="prefix" animation size="small" textPosition="right" />
          Loading...
        </BqOption>
      ) : error ? (
        <BqOption disabled>
          <BqIcon slot="prefix" name="warning" />
          {error}
        </BqOption>
      ) : visibleOptions.length === 0 ? (
        <BqOption disabled>
          <BqIcon slot="prefix" name="x-circle" />
          No results found
        </BqOption>
      ) : (
        visibleOptions.map((option) => (
          <BqOption key={option.value} value={option.value} displayValue={option.displayValue}>
            <BqIcon slot="prefix" name={option.icon} />
            <span dangerouslySetInnerHTML={{ __html: option.label }} />
          </BqOption>
        ))
      )}
    </BqSelect>
  );
}
```

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

const ALL_OPTIONS = [
  { label: 'Running', value: 'running', icon: 'sneaker-move', displayValue: 'Running' },
  { label: 'Hiking', value: 'hiking', icon: 'boot', displayValue: 'Hiking' },
  { label: 'Biking', value: 'biking', icon: 'person-simple-bike', displayValue: 'Biking' },
  { label: 'Swimming', value: 'swimming', icon: 'swimming-pool', displayValue: 'Swimming' },
  { label: 'Pizza', value: 'pizza', icon: 'pizza', displayValue: 'Pizza' },
  { label: 'Hamburger', value: 'hamburger', icon: 'hamburger', displayValue: 'Hamburger' },
  { label: 'Cookie', value: 'cookie', icon: 'cookie', displayValue: 'Cookie' },
  { label: 'Ice-cream', value: 'ice-cream', icon: 'ice-cream', displayValue: 'Ice-cream' },
];

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqIcon, BqOption, BqSelect, BqSpinner],
  template: `
    <bq-select
      placeholder="Search options..."
      debounce-time="300"
      (bqInput)="handleInput($event)"
      (bqSelect)="handleSelect()"
    >
      <label slot="label">Custom filtering</label>
      @if (isLoading) {
        <bq-option disabled>
          <bq-spinner slot="prefix" animation size="small" text-position="right"></bq-spinner>
          Loading...
        </bq-option>
      } @else {
        @if (visibleOptions.length === 0) {
          <bq-option disabled>
            <bq-icon slot="prefix" name="x-circle"></bq-icon>
            No results found
          </bq-option>
        }
        @for (option of visibleOptions; track option.value) {
          <bq-option [value]="option.value" [attr.display-value]="option.displayValue">
            <bq-icon slot="prefix" [name]="option.icon"></bq-icon>
            <span [innerHTML]="option.label"></span>
          </bq-option>
        }
      }
    </bq-select>
  `
})
export class AppComponent {
  visibleOptions = [...ALL_OPTIONS];
  isLoading = false;

  handleInput(event: BqSelectCustomEvent<{ value: string }>): void {
    event.preventDefault();
    event.target.open = true;
    const query = event.detail.value;

    if (!query) {
      this.visibleOptions = [...ALL_OPTIONS];
      return;
    }

    this.isLoading = true;
    const q = query.toLowerCase();
    const escaped = query.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');

    setTimeout(() => {
      this.isLoading = false;
      this.visibleOptions = ALL_OPTIONS
        .filter((o) => o.label.toLowerCase().includes(q))
        .map((o) => ({
          ...o,
          label: o.label.replace(new RegExp(`(${escaped})`, 'gi'), '<b>$1</b>'),
        }));
    }, 300);
  }

  handleSelect(): void {
    this.visibleOptions = [...ALL_OPTIONS];
  }
}
```

```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<template>
  <BqSelect
    placeholder="Search options..."
    :debounceTime="300"
    @bqInput="handleInput"
    @bqSelect="handleSelect"
  >
    <label slot="label">Custom filtering</label>
    <BqOption v-if="isLoading" disabled>
      <BqSpinner slot="prefix" animation size="small" textPosition="right" />
      Loading...
    </BqOption>
    <template v-if="!isLoading">
      <BqOption v-if="visibleOptions.length === 0" disabled>
        <BqIcon slot="prefix" name="x-circle" />
        No results found
      </BqOption>
      <BqOption v-for="option in visibleOptions" :key="option.value" :value="option.value" :displayValue="option.displayValue">
        <BqIcon slot="prefix" :name="option.icon" />
        <span v-html="option.label" />
      </BqOption>
    </template>
  </BqSelect>
</template>

<script setup>
import { ref } from 'vue';
import { BqIcon, BqOption, BqSelect, BqSpinner } from '@beeq/vue';

const ALL_OPTIONS = [
  { label: 'Running', value: 'running', icon: 'sneaker-move', displayValue: 'Running' },
  { label: 'Hiking', value: 'hiking', icon: 'boot', displayValue: 'Hiking' },
  { label: 'Biking', value: 'biking', icon: 'person-simple-bike', displayValue: 'Biking' },
  { label: 'Swimming', value: 'swimming', icon: 'swimming-pool', displayValue: 'Swimming' },
  { label: 'Pizza', value: 'pizza', icon: 'pizza', displayValue: 'Pizza' },
  { label: 'Hamburger', value: 'hamburger', icon: 'hamburger', displayValue: 'Hamburger' },
  { label: 'Cookie', value: 'cookie', icon: 'cookie', displayValue: 'Cookie' },
  { label: 'Ice-cream', value: 'ice-cream', icon: 'ice-cream', displayValue: 'Ice-cream' },
];

const visibleOptions = ref([...ALL_OPTIONS]);
const isLoading = ref(false);

function highlight(text, query) {
  const escaped = query.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
  return text.replace(new RegExp(`(${escaped})`, 'gi'), '<b>$1</b>');
}

async function handleInput(event) {
  event.preventDefault();
  event.target.open = true;
  const query = event.detail.value;

  if (!query) {
    visibleOptions.value = [...ALL_OPTIONS];
    return;
  }

  isLoading.value = true;

  try {
    await new Promise((resolve) => setTimeout(resolve, 300));
    const q = query.toLowerCase();
    visibleOptions.value = ALL_OPTIONS
      .filter((o) => o.label.toLowerCase().includes(q))
      .map((o) => ({ ...o, label: highlight(o.label, query) }));
  } finally {
    isLoading.value = false;
  }
}

function handleSelect() {
  visibleOptions.value = [...ALL_OPTIONS];
}
</script>
```

### Form integration

`bq-select` is form-associated, so it participates in native submission, reset, and required validation. Use `name` for the submitted key, `required` for browser validation, and `form-validation-message` for a custom native validation message.

> [!NOTE]
>
> The live preview runs in an iframe sandbox that does not allow native form submission. Its Submit button uses `type="button"` and `bqClick` to validate the form and display `FormData` without submitting it. The copyable examples use native `type="submit"` buttons for normal application forms.

```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
<form id="select-form">
  <bq-select
    form-validation-message="Choose a support plan"
    name="supportPlan"
    placeholder="Choose a plan"
    required
  >
    <label slot="label">Support plan</label>
    <span slot="helper-text">Choose the plan that matches your expected response time.</span>
    <bq-option value="standard">Standard</bq-option>
    <bq-option value="priority">Priority</bq-option>
    <bq-option value="enterprise">Enterprise</bq-option>
  </bq-select>
  <bq-button appearance="secondary" type="reset">Reset</bq-button>
  <bq-button type="submit">Submit</bq-button>
  <pre id="select-output">{}</pre>
</form>

<script>
  const form = document.querySelector('#select-form');
  const output = document.querySelector('#select-output');

  form.addEventListener('submit', (event) => {
    event.preventDefault();
    output.textContent = JSON.stringify(Object.fromEntries(new FormData(form).entries()), null, 2);
  });

  form.addEventListener('reset', () => {
    requestAnimationFrame(() => {
      output.textContent = '{}';
    });
  });
</script>
```

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

export default function SelectForm() {
  const [data, setData] = useState("{}");

  return (
    <form
      onReset={() => setData("{}")}
      onSubmit={(event) => {
        event.preventDefault();
        setData(JSON.stringify(Object.fromEntries(new FormData(event.currentTarget).entries()), null, 2));
      }}
    >
      <BqSelect
        formValidationMessage="Choose a support plan"
        name="supportPlan"
        placeholder="Choose a plan"
        required
      >
        <label slot="label">Support plan</label>
        <span slot="helper-text">Choose the plan that matches your expected response time.</span>
        <BqOption value="standard">Standard</BqOption>
        <BqOption value="priority">Priority</BqOption>
        <BqOption value="enterprise">Enterprise</BqOption>
      </BqSelect>
      <BqButton appearance="secondary" type="reset">Reset</BqButton>
      <BqButton type="submit">Submit</BqButton>
      <pre>{data}</pre>
    </form>
  );
}
```

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

@Component({
  selector: "app-root",
  standalone: true,
  imports: [BqButton, BqOption, BqSelect],
  template: `
    <form (reset)="data = '{}'" (submit)="handleSubmit($event)">
      <bq-select
        form-validation-message="Choose a support plan"
        name="supportPlan"
        placeholder="Choose a plan"
        required
      >
        <label slot="label">Support plan</label>
        <span slot="helper-text">Choose the plan that matches your expected response time.</span>
        <bq-option value="standard">Standard</bq-option>
        <bq-option value="priority">Priority</bq-option>
        <bq-option value="enterprise">Enterprise</bq-option>
      </bq-select>
      <bq-button appearance="secondary" type="reset">Reset</bq-button>
      <bq-button type="submit">Submit</bq-button>
      <pre>{{ data }}</pre>
    </form>
  `,
})
export class SelectFormComponent {
  data = "{}";

  handleSubmit(event: SubmitEvent): void {
    event.preventDefault();
    this.data = JSON.stringify(Object.fromEntries(new FormData(event.target as HTMLFormElement).entries()), null, 2);
  }
}
```

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

const data = ref("{}");

function handleSubmit(event: Event) {
  data.value = JSON.stringify(Object.fromEntries(new FormData(event.target as HTMLFormElement).entries()), null, 2);
}
</script>

<template>
  <form @reset="data = '{}'" @submit.prevent="handleSubmit">
    <BqSelect
      formValidationMessage="Choose a support plan"
      name="supportPlan"
      placeholder="Choose a plan"
      required
    >
      <label slot="label">Support plan</label>
      <span slot="helper-text">Choose the plan that matches your expected response time.</span>
      <BqOption value="standard">Standard</BqOption>
      <BqOption value="priority">Priority</BqOption>
      <BqOption value="enterprise">Enterprise</BqOption>
    </BqSelect>
    <BqButton appearance="secondary" type="reset">Reset</BqButton>
    <BqButton type="submit">Submit</BqButton>
    <pre>{{ data }}</pre>
  </form>
</template>
```

## Best practices

> [card]
>
> Do
>
> Always populate the `label` slot so the select has an accessible name visible to all users, not just those relying on assistive technology.

> [card]
>
> Don't
>
> Leave the `label` slot empty and rely solely on `placeholder` text — placeholder disappears once a value is selected and is not announced reliably by screen readers.

> [card]
>
> Do
>
> Write a clear, neutral placeholder such as "Choose a country" so users understand the field is interactive and what kind of value they are selecting.

> [card]
>
> Don't
>
> Use the placeholder as a label substitute or write a directive like "Select" without context — this gives users no information about what the field is for.

> [card]
>
> Do
>
> Use `validation-status` and the `helper-text` slot together when the field is required or has a validation error, so users understand exactly what is wrong and how to fix it.

> [card]
>
> Don't
>
> Apply `validation-status="error"` without a helper text message — a red border alone does not tell users what is wrong or how to correct it.

> [card]
>
> Do
>
> Provide meaningful option labels that describe the value clearly — e.g., "Europe" instead of "EU", "Pro plan (\$49/mo)" instead of "pro".

> [card]
>
> Don't
>
> Use internal codes, abbreviations, or IDs as the visible option labels — what is meaningful in your database is not necessarily meaningful to users.

## Accessibility

* **Built in:** the native `<input>` inside the control has `role="combobox"`, `aria-haspopup` (`"listbox"` for flat options or `"tree"` for nested options), `aria-expanded` (toggled when the panel opens and closes), and `aria-controls` pointing to the options container by `id`.
* **Built in:** `aria-disabled="true"` is applied on the input when `disabled` is set.
* **Built in:** the component is form-associated via `ElementInternals`, so it works with native `<form>` elements, `required` validation, and `formResetCallback`.
* **Built in:** opening the panel closes any other open select, date picker, or dropdown panel, so only one panel stays open at a time.
* **Built in:** nested multi-select changes the option container to a tree.
* **Built in:** parent tree items expose checked, unchecked, or mixed state as their descendants are selected, and `aria-expanded` communicates whether a branch is open. The separate visual expand button is hidden from assistive technology and removed from the Tab order; keyboard users expand and collapse the focused tree item with `ArrowRight` and `ArrowLeft`.
* **Built in:** text in the `label` slot names the combobox. The `name` prop is the form submission key, not the accessible name.
* **Your responsibility:** you must provide text in the `label` slot. The component associates its native `<label>` with the combobox input through `for` and `id`. You should use visually hidden text when the layout cannot show a visible label.
* **Your responsibility:** when `validation-status` is `"error"`, you must populate the `helper-text` slot with a clear error description. The component does not set `aria-describedby` or `aria-invalid` on the input, so you must not rely on color alone to communicate the error.
* **Your responsibility:** if options are loaded asynchronously, you should show a disabled loading option in the default slot, as in the custom filtering example. `panel` is a shadow part for styling, not a slot.
* **Your responsibility:** you must give every nested option a unique `value`. Values are used for selection state, form submission, tags, and the `selectionTree` event detail.

### Keyboard interaction

The native `input` is the only tab stop. The clear button has `tabindex="-1"` and the nested expand buttons are removed from the Tab order.

| Key | Context | Action |
| - | - | - |
| `Tab` | Any | Moves focus to the input without opening the panel |
| Printable characters | Input focused, `disable-search` not set | Filters the options |
| `ArrowDown` | Input focused, panel closed | Opens the panel and moves focus to the first option |
| `ArrowUp` | Input focused, panel closed | Opens the panel and moves focus to the last option |
| `ArrowDown` | Input focused, panel open | Moves focus to the first option |
| `ArrowUp` | Input focused, panel open | Moves focus to the last option |
| `ArrowDown` | Option focused | Moves focus to the next option |
| `ArrowUp` | Option focused | Moves focus to the previous option |
| `Home` | Option focused | Moves focus to the first option |
| `End` | Option focused | Moves focus to the last option |
| `Enter` | Option focused | Selects the focused option without changing tree expansion |
| `Space` | Option focused | Selects the focused option without changing tree expansion |
| `Escape` | Panel open | Closes the panel and returns focus to the input without changing the selection |
| `Backspace` | `multiple`, input empty | Removes the most recently added tag |
| `ArrowRight` | Nested options, option focused | Expands a collapsed branch, or moves focus to its first child |
| `ArrowLeft` | Nested options, option focused | Collapses an expanded branch, or moves focus to the parent option |

### Rules

| Rule | Strength | Verified by |
| - | - | - |
| Provide text in the `label` slot, visually hidden when the layout hides it | MUST | manual: inspect the visible or visually hidden label text |
| Do not use `placeholder` as the only label | MUST NOT | manual: check that the label remains when the placeholder is removed |
| Populate the `helper-text` slot when `validation-status` is `"error"` | MUST | manual: inspect the error state and helper text together |
| Set `name` so the value is submitted with the form | MUST | automated: [`bq-select.e2e.tsx`](https://github.com/Endava/BEEQ/blob/main/packages/beeq/src/components/select/__tests__/bq-select.e2e.tsx) checks `FormData` |
| Set `required` when a selection is mandatory so the form is invalid while no value is selected | MUST | automated: [`bq-select.e2e.tsx`](https://github.com/Endava/BEEQ/blob/main/packages/beeq/src/components/select/__tests__/bq-select.e2e.tsx) checks `form.checkValidity()` |
| Give every nested option a unique `value` | MUST | automated: [`bq-select.e2e.tsx`](https://github.com/Endava/BEEQ/blob/main/packages/beeq/src/components/select/__tests__/bq-select.e2e.tsx) checks duplicate-value errors |
| Show a disabled loading option while options load asynchronously | SHOULD | manual: inspect the option list while loading |

## API reference

### Properties

| Property | Attribute | Description | Type | Default |
| - | - | - | - | - |
| `autofocus` | `autofocus` | If `true`, the Select input will be focused on component render | `boolean` | — |
| `clearButtonLabel` | `clear-button-label` | The aria label for the clear button | `string` | `'Clear value'` |
| `debounceTime` | `debounce-time` | Milliseconds to wait before emitting `bqInput` after typing. With `0`, `bqInput` is emitted synchronously | `number` | `0` |
| `disableClear` | `disable-clear` | If `true`, the clear button is hidden | `boolean` | `false` |
| `disableSearch` | `disable-search` | If `true`, typing in the input is disabled while option selection remains available | `boolean` | `false` |
| `disabled` | `disabled` | If `true`, the select cannot be interacted with | `boolean` | `false` |
| `disableScrollLock` | `disable-scroll-lock` | If `true`, the page body scroll will not be locked when the panel is open | `boolean` | `false` |
| `distance` | `distance` | Gap in pixels between the panel and the input element | `number` | `8` |
| `enableCheckboxes` | `enable-checkboxes` | If `true` with `multiple`, flat options render checkboxes. Nested multi-select options always render checkboxes | `boolean` | — |
| `form` | `form` | The `id` of the `<form>` element this select belongs to | `string` | — |
| `formValidationMessage` | `form-validation-message` | Native validation message used when `required` is set | `string` | — |
| `keepOpenOnSelect` | `keep-open-on-select` | If `true`, the panel stays open after a selection | `boolean` | `false` |
| `maxTagsVisible` | `max-tags-visible` | Maximum number of tags shown in multi-select mode before a `+N` tag appears | `number` | `2` |
| `multiple` | `multiple` | If `true`, the select allows multiple selections | `boolean` | `false` |
| `name` | `name` | The form control name, submitted as part of a name/value pair. **Required** for form submission | `string` | — |
| `open` | `open` | If `true`, the panel is visible | `boolean` | `false` |
| `panelHeight` | `panel-height` | Overrides the default height of the Select panel | `string` | — |
| `placeholder` | `placeholder` | Placeholder text shown when no value is selected | `string` | — |
| `placement` | `placement` | Position of the Select panel relative to the input | `'bottom' \| 'bottom-end' \| 'bottom-start' \| 'left' \| 'left-end' \| 'left-start' \| 'right' \| 'right-end' \| 'right-start' \| 'top' \| 'top-end' \| 'top-start'` | `'bottom'` |
| `readonly` | `readonly` | **Deprecated.** Use `disableSearch` to allow selection without text filtering. In a future major release, `readonly` will prevent changing the selected value instead of disabling filtering | `boolean` | — |
| `required` | `required` | If `true`, a value must be selected before the form can be submitted | `boolean` | — |
| `sameWidth` | `same-width` | If `true`, the panel matches the width of the input element | `boolean` | `true` |
| `skidding` | `skidding` | Offset in pixels along the input element axis | `number` | `0` |
| `strategy` | `strategy` | CSS position strategy used to place the panel | `'fixed' \| 'absolute'` | `'fixed'` |
| `validationStatus` | `validation-status` | Visual validation state of the select | `'error' \| 'none' \| 'success' \| 'warning'` | `'none'` |
| `value` | `value` | The currently selected value; can be a string or array of strings in multi-select mode | `string \| string[]` | — |

### Invalid combinations

| Combination | Strength | Result |
| - | - | - |
| Nested `bq-option` children (`slot="options"`) without `multiple` | MUST NOT | Nested descendants are unavailable and the component logs a console warning |
| Removing `multiple` while nested options exist | MUST NOT | The selection is cleared and `value` resets to an empty string |
| Duplicate `value` across nested options | MUST NOT | The component logs a console error and the `value` and event payload become ambiguous |
| `enable-checkboxes` without `multiple` | SHOULD NOT | No checkboxes render because they require `multiple` |

### Methods

| Method | Parameters | Returns | Description |
| - | - | - | - |
| `clear()` | — | `Promise<void>` | Clears the selected value and resets the input |
| `reset(value)` | `value: string \| string[]` | `Promise<void>` | Resets the select to the supplied `value` |

### Events

| Event | Description |
| - | - |
| `bqBlur` | Emitted when focus leaves the entire Select, including its input, options, and controls |
| `bqClear` | Emitted when the selected value has been cleared, including complete text deletion in a searchable single-select. Detail is the Select element |
| `bqFocus` | Emitted when focus enters the Select from outside the component |
| `bqInput` | Emitted when the input value changes while typing; detail is `{ value: string \| number \| string[] }` |
| `bqSelect` | Emitted when the selected value changes. Detail includes `value` and `item`; nested multi-select also includes selected paths in `selectionTree` |

### Slots

| Slot | Description |
| - | - |
| *(default)* | The `bq-option` elements that make up the option list |
| `label` | The label displayed above the input |
| `prefix` | Content shown before the value text inside the control |
| `tags` | Replaces the auto-generated tag list in multi-select mode |
| `clear-icon` | Replaces the default clear icon inside the clear button |
| `suffix` | Content shown after the value text; defaults to a chevron caret |
| `helper-text` | Text shown below the input for guidance or validation messages |

### Shadow parts

| Part | Description |
| - | - |
| `base` | The component's root wrapper `<div>` |
| `button` | The native `<button>` inside the clear button |
| `clear-btn` | The `bq-button` used as the clear button |
| `control` | The input control wrapper `<div>` |
| `input-outline` | The inner `<div>` that holds the tags and the native input |
| `helper-text` | The helper text slot container |
| `input` | The native `<input>` element |
| `label` | The label slot container |
| `panel` | The floating panel container |
| `prefix` | The prefix slot container |
| `suffix` | The suffix slot container |
| `tags` | The tag container `<span>` for multi-selection |
| `tag` | Each individual tag wrapper |
| `tag__base` | The base wrapper of each `bq-tag` |
| `tag__prefix` | The prefix slot container of each `bq-tag` |
| `tag__text` | The text slot container of each `bq-tag` |
| `tag__btn-close` | The close button of each `bq-tag` |
| `option-list` | The `bq-option-list` container |

### CSS custom properties

**CSS variables**

| Variable | Description | Default |
| - | - | - |
| `--bq-select--background-color` | Select background color | `var(--bq-ui--primary)` |
| `--bq-select--border-color` | Select border color | `var(--bq-stroke--tertiary)` |
| `--bq-select--border-color-focus` | Select border color on focus | `var(--bq-stroke--brand)` |
| `--bq-select--border-color-danger` | Select border color when the validation status is `error` | `var(--bq-stroke--danger)` |
| `--bq-select--border-color-success` | Select border color when the validation status is `success` | `var(--bq-stroke--success)` |
| `--bq-select--border-color-warning` | Select border color when the validation status is `warning` | `var(--bq-stroke--warning)` |
| `--bq-select--border-radius` | Select border radius | `var(--bq-radius--s)` |
| `--bq-select--border-width` | Select border width | `var(--bq-stroke-s)` |
| `--bq-select--border-style` | Select border style | `solid` |
| `--bq-select--gap` | Gap between select content and prefix/suffix | `var(--bq-spacing-xs)` |
| `--bq-select--helper-margin-top` | Helper text top margin | `var(--bq-spacing-xs)` |
| `--bq-select--helper-text-color` | Helper text color | `var(--bq-text--primary)` |
| `--bq-select--helper-text-color-danger` | Helper text color when the validation status is `error` | `var(--bq-text--danger)` |
| `--bq-select--helper-text-color-success` | Helper text color when the validation status is `success` | `var(--bq-text--success)` |
| `--bq-select--helper-text-color-warning` | Helper text color when the validation status is `warning` | `var(--bq-text--warning)` |
| `--bq-select--helper-text-size` | Helper text font size | `var(--bq-font-size--s)` |
| `--bq-select--icon-size` | Size of icons in prefix, suffix, and clear button | `24px` |
| `--bq-select--label-margin-bottom` | Label bottom margin | `var(--bq-spacing-xs)` |
| `--bq-select--label-text-color` | Label text color | `var(--bq-text--primary)` |
| `--bq-select--label-text-size` | Label font size | `var(--bq-font-size--s)` |
| `--bq-select--padding-start` | Inline-start padding of the control | `calc(var(--bq-spacing-m) - var(--bq-select--border-width))` |
| `--bq-select--padding-end` | Inline-end padding of the control | `calc(var(--bq-spacing-m) - var(--bq-select--border-width))` |
| `--bq-select--paddingY` | Block (top and bottom) padding of the control | `calc(var(--bq-spacing-s) - var(--bq-select--border-width))` |
| `--bq-select--text-color` | Input text color | `var(--bq-text--primary)` |
| `--bq-select--text-size` | Input text font size | `var(--bq-font-size--m)` |
| `--bq-select--text-placeholder-color` | Placeholder text color | `var(--bq-text--secondary)` |

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

## Resources

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

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


## Related topics

- [Date Picker](https://www.beeq.design/components/date-picker.md)
- [Table](https://www.beeq.design/components/table.md)
- [Option](https://www.beeq.design/components/option.md)
- [Tab](https://www.beeq.design/components/tab.md)


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