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

> The select input lets users choose one or more options from a predefined list, commonly used in forms for easy data selection.

export const CodeLivePreview = ({code, children, height, removePadding = false, mode = 'shadow'}) => {
  const previewRef = useRef(null);
  const BEEQ_ESM_URL = 'https://esm.sh/@beeq/core/dist/beeq/beeq.esm.js';
  const BEEQ_CSS_URL = 'https://esm.sh/@beeq/core/dist/beeq/beeq.css';
  const BEEQ_ICONS_URL = 'https://esm.sh/@beeq/core/dist/beeq/svg';
  const ensureParentBeeqRuntime = () => {
    if (document.querySelector('script[data-beeq-parent-runtime]')) return;
    const script = document.createElement('script');
    script.type = 'module';
    script.src = BEEQ_ESM_URL;
    script.dataset.beeqParentRuntime = BEEQ_ICONS_URL;
    document.head.appendChild(script);
  };
  const executeSnippetScripts = (root, runtimeWindow, previewRootArg, skipAttr) => {
    root.querySelectorAll('script').forEach(oldScript => {
      if (skipAttr && oldScript.hasAttribute(skipAttr)) return;
      if (oldScript.src) {
        const newScript = runtimeWindow.document.createElement('script');
        newScript.src = oldScript.src;
        oldScript.replaceWith(newScript);
        return;
      }
      runtimeWindow.Function('previewRoot', oldScript.textContent || '')(previewRootArg);
      oldScript.remove();
    });
  };
  const syncIframeMode = iframeDoc => {
    const root = document.documentElement;
    const explicitMode = root.getAttribute('bq-mode');
    const isDark = root.classList.contains('dark');
    const resolvedMode = explicitMode || (isDark ? 'dark' : 'light');
    iframeDoc.documentElement.setAttribute('bq-mode', resolvedMode);
    iframeDoc.body.setAttribute('bq-mode', resolvedMode);
  };
  useEffect(() => {
    if (mode === 'shadow') ensureParentBeeqRuntime();
  }, [mode]);
  useEffect(() => {
    const container = previewRef.current;
    if (!container) return;
    if (removePadding) container.style.padding = '0';
    container.innerHTML = '';
    if (mode === 'iframe') {
      const iframe = document.createElement('iframe');
      iframe.className = 'preview-iframe';
      iframe.style.width = '100%';
      iframe.style.border = '0';
      iframe.style.display = 'block';
      iframe.style.minHeight = height ?? '0px';
      iframe.setAttribute('title', 'Live code preview');
      iframe.setAttribute('loading', 'lazy');
      iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin');
      container.appendChild(iframe);
      const iframeDoc = iframe.contentDocument;
      const iframeWin = iframe.contentWindow;
      if (!iframeDoc || !iframeWin) return;
      iframeDoc.open();
      iframeDoc.write(['<!doctype html>', '<html>', '<head>', '  <meta charset="utf-8" />', '  <meta name="viewport" content="width=device-width, initial-scale=1" />', '  <style>html,body{margin:0;padding:0;min-height:100%;}</style>', `  <link rel="stylesheet" href="${BEEQ_CSS_URL}" />`, `  <script type="module" src="${BEEQ_ESM_URL}" data-beeq-iframe-runtime="${BEEQ_ICONS_URL}"></script>`, '</head>', '<body>', code, '</body>', '</html>'].join('\n'));
      iframeDoc.close();
      syncIframeMode(iframeDoc);
      const modeObserver = new MutationObserver(() => syncIframeMode(iframeDoc));
      modeObserver.observe(document.documentElement, {
        attributes: true,
        attributeFilter: ['class', 'bq-mode']
      });
      executeSnippetScripts(iframeDoc, iframeWin, iframeDoc, 'data-beeq-iframe-runtime');
      return () => modeObserver.disconnect();
    }
    const shadowRoot = container.shadowRoot ?? container.attachShadow({
      mode: 'open'
    });
    if (!shadowRoot.adoptedStyleSheets.length) {
      const fixSheet = new CSSStyleSheet();
      fixSheet.replaceSync(`
        bq-dropdown::part(panel),
        bq-panel::part(panel),
        bq-select::part(panel),
        bq-date-picker::part(panel) { z-index: 9999; }
        bq-tooltip::part(panel) { position: absolute; }
      `);
      shadowRoot.adoptedStyleSheets = [fixSheet];
    }
    shadowRoot.innerHTML = [`<link rel="stylesheet" href="${BEEQ_CSS_URL}">`, code].join('');
    executeSnippetScripts(shadowRoot, window, shadowRoot);
    return undefined;
  }, [code, mode, height]);
  return <div className="code-live-preview not-prose">
      {}
      <div className="preview" ref={previewRef} style={{
    minHeight: height
  }} />

      {}
      {children && <div className="code">{children}</div>}
    </div>;
};

export const CardTile = ({title, href, imageLightSrc, imageDarkSrc, children, enableImgZoom}) => {
  if (!href) {
    return <div className="card-tile block font-normal group relative my-2 ring-2 ring-transparent rounded-2xl overflow-hidden w-full">
        {imageLightSrc && <img className="w-full m-0 block dark:hidden" src={imageLightSrc} alt={title} {...enableImgZoom ? {
      zoom: true
    } : {
      noZoom: true
    }} />}
        {imageDarkSrc && <img className="w-full m-0 hidden dark:block" src={imageDarkSrc} alt={title} {...enableImgZoom ? {
      zoom: true
    } : {
      noZoom: true
    }} />}
        {title && <h2 className="mt-4 mb-2 px-6 text-base font-semibold">{title}</h2>}
        <div className="px-6 pb-5">{children}</div>
      </div>;
  }
  return <a href={href} className="card-tile block font-normal group relative my-2 ring-2 ring-transparent rounded-2xl overflow-hidden w-full cursor-pointer">
      {imageLightSrc && <img className="w-full m-0 block dark:hidden" src={imageLightSrc} alt={title} noZoom />}
      {imageDarkSrc && <img className="w-full m-0 hidden dark:block" src={imageDarkSrc} alt={title} noZoom />}
      {title && <h2 className="mt-4 mb-2 px-6 text-base font-semibold">{title}</h2>}
      <div className="px-6 pb-5">{children}</div>
    </a>;
};

<Frame className="px-4 py-4" caption="Select component overview">
  <img className="block dark:hidden" src="https://mintlify.s3.us-west-1.amazonaws.com/beeq/components/images/select/select-overview-light.svg" alt="BEEQ Select component overview" />

  <img className="hidden dark:block" src="https://mintlify.s3.us-west-1.amazonaws.com/beeq/components/images/select/select-overview-dark.svg" alt="BEEQ Select component overview" />
</Frame>

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

<CardGroup cols={2}>
  <Card>
    <span className="flex items-center mr-2 text-lg font-medium" role="heading">
      <Icon className="mr-2" icon="thumbs-up" iconType="solid" size={20} color="var(--bq-stroke--success)" />

      Use Select when
    </span>

    * 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>

  <Card>
    <span className="flex items-center mr-2 text-lg font-medium" role="heading">
      <Icon className="mr-2" icon="thumbs-down" iconType="solid" size={20} color="var(--bq-stroke--danger)" />

      Do not use Select when
    </span>

    * 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](/components/input) instead
    * The choices are binary (yes / no, on / off) — use a [Checkbox](/components/checkbox) or toggle instead
  </Card>
</CardGroup>

## Patterns

<CardGroup cols={2}>
  <Card title="Single select">
    Single Select allows the user to pick one option from a menu.
  </Card>

  <Card title="Multiple select">
    Multiple Select allows the user to pick multiple options from a menu via checkboxes. Once selected, the items are shown as dismissible tags in the input field above.
  </Card>
</CardGroup>

## Anatomy

<Frame className="px-4 py-4" caption="Select component anatomy">
  <img className="block dark:hidden" src="https://mintlify.s3.us-west-1.amazonaws.com/beeq/components/images/select/select-anatomy-light.svg" alt="BEEQ Select component anatomy" />

  <img className="hidden dark:block" src="https://mintlify.s3.us-west-1.amazonaws.com/beeq/components/images/select/select-anatomy-dark.svg" alt="BEEQ Select component anatomy" />
</Frame>

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                         |
| **2**  | Input field                   | The control area that displays the selected value or placeholder               |
| **3**  | Leading icon                  | Optional prefix icon displayed at the start of the input field                 |
| **4**  | Placeholder                   | The hint text shown inside the input when no value is selected                 |
| **5**  | Dropdown panel                | The floating container that opens below the input and holds the option list    |
| **6**  | Menu                          | The list of selectable `bq-option` items inside the dropdown panel             |
| **7**  | Scroll                        | The scrollbar that appears when the option list overflows the panel height     |
| **8**  | Dropdown icon                 | The chevron caret at the end of the input that indicates the open/closed state |
| **9**  | Field status label (optional) | Helper text below the input providing guidance or validation feedback          |
| **10** | Info label (icon)             | Optional icon accompanying the field status label for additional context       |

## Design guidelines

### Single vs. multiple selection

<CardGroup cols={2}>
  <CardTile title="Single selection" imageLightSrc="/components/images/select/select-single-light.svg" imageDarkSrc="/components/images/select/select-single-dark.svg">
    The default mode. Users pick exactly one option; the selected value replaces the placeholder text in the input.
  </CardTile>

  <CardTile title="Multiple selection" imageLightSrc="/components/images/select/select-multiple-light.svg" imageDarkSrc="/components/images/select/select-multiple-dark.svg">
    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.
  </CardTile>
</CardGroup>

### Validation states

<CardGroup cols={2}>
  <CardTile title="Error state" imageLightSrc="/components/images/select/select-error-light.svg" imageDarkSrc="/components/images/select/select-error-dark.svg">
    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.
  </CardTile>

  <CardTile title="Success state" imageLightSrc="/components/images/select/select-success-light.svg" imageDarkSrc="/components/images/select/select-success-dark.svg">
    Set `validation-status="success"` to confirm a valid selection. Use sparingly — only when confirmation meaningfully reduces user uncertainty.
  </CardTile>
</CardGroup>

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

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }
span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>

<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>
`}
>
  <CodeGroup>
    ```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>
    ```
  </CodeGroup>
</CodeLivePreview>

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

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }
span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>

<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>
`}
>
  <CodeGroup>
    ```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>
    ```
  </CodeGroup>
</CodeLivePreview>

### Initial value

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

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }
span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>
<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>
`}
>
  <CodeGroup>
    ```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>
    ```
  </CodeGroup>
</CodeLivePreview>

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

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }

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

<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>
`}
>
  <CodeGroup>
    ```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>
    ```
  </CodeGroup>
</CodeLivePreview>

### Disabled

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

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }
span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>

<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>
`}
>
  <CodeGroup>
    ```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>
    ```
  </CodeGroup>
</CodeLivePreview>

### Multiple

Use the `multiple` property to enable multiple selections. 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.

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }
span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>

<bq-select
multiple
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>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-select
      multiple
      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
      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
          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
        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>
    ```
  </CodeGroup>
</CodeLivePreview>

## Options

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

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }
span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>

<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>
`}
>
  <CodeGroup>
    ```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>
    ```
  </CodeGroup>
</CodeLivePreview>

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

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }
span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>

<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>
`}
>
  <CodeGroup>
    ```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>
    ```
  </CodeGroup>
</CodeLivePreview>

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

<CodeLivePreview
  mode="shadow"
  code={`
<style>
:host { gap: var(--bq-spacing-l) !important; }
bq-select::part(panel) { z-index: 12; }

span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>

<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>
`}
>
  <CodeGroup>
    ```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>
    ```
  </CodeGroup>
</CodeLivePreview>

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

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }

div {
  display: flex;
  flex: 1 1 0%;
}

div > label {
  display: flex;
  flex-grow: 1;
  align-items: center;
}

div > span {
  color: var(--bq-text--secondary);
}

span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>

<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>
`}
>
  <CodeGroup>
    ```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";

    <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>
      `
    })
    export class AppComponent {}
    ```

    ```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <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>

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

### Label with "Info Tooltip"

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

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }

bq-tooltip {
  margin-inline-start: var(--bq-spacing-xs);
}

div {
  display: flex;
  flex: 1 1 0%;
}

div > label {
  display: flex;
  flex-grow: 1;
  align-items: center;
}

div > span {
  color: var(--bq-text--secondary);
}

span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>

<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>
`}
>
  <CodeGroup>
    ```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";

    <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>
      `
    })
    export class AppComponent {}
    ```

    ```vue Vue icon="vuejs" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <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>

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

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

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }

bq-tooltip {
  margin-inline-start: var(--bq-spacing-xs);
}

label {
  display: flex;
  flex-grow: 1;
  align-items: center;
}

span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>

<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>
`}
>
  <CodeGroup>
    ```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"}}
    <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>

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

### With no label

Use this style when you prefer a minimal look and the field's purpose is conveyed by surrounding context — for example, inside a table or toolbar where a visible label would be redundant.

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }

span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>

<bq-select placeholder="Placeholder">
<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>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-select placeholder="Placeholder">
      <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">
      <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">
          <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">
        <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>
    ```
  </CodeGroup>
</CodeLivePreview>

### With no Helper Text

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

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }
</style>

<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>
`}
>
  <CodeGroup>
    ```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"}}
    <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>

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

### Readonly

A readonly select shows the current value but prevents the panel from opening. Use it in review or summary screens where the displayed value is informational and should not be changed.

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }

span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>

<bq-select placeholder="Placeholder" value="2" readonly>
<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>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-select placeholder="Placeholder" value="2" readonly>
      <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" readOnly>
      <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" readonly>
          <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" readonly>
        <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>
    ```
  </CodeGroup>
</CodeLivePreview>

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

<CodeLivePreview
  mode="shadow"
  code={`
<style>
bq-select::part(panel) { z-index: 12; }

span {
  display: flex;
  align-items: center;
  gap: var(--bq-spacing-xs);
}
</style>

<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>
`}
>
  <CodeGroup>
    ```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"}}
    <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>

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

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

<Tip>
  Set `debounce-time` to throttle how often `bqInput` fires while the user types — `300` ms is a good default for async requests.
</Tip>

<CodeLivePreview
  mode="shadow"
  code={`
<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 = previewRoot.querySelector('#custom-select');
  const staticOpts = Array.from(select.querySelectorAll('bq-option'));

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

  function removeTempOpts() {
    select.querySelectorAll('bq-option[data-temp]').forEach(function(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(function(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(function(resolve) { setTimeout(resolve, 500); });
    const q = query.toLowerCase();
    return staticOpts.filter(function(opt) {
      return opt.getAttribute('data-label').toLowerCase().includes(q);
    });
  }

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

    removeTempOpts();

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

    staticOpts.forEach(function(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(function(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', function() {
    removeTempOpts();
    showAllOptions();
  });
})();
</script>
`}
>
  <CodeGroup>
    ```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();
        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>
    ```

    ```jsx 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) {
      return text.replace(new RegExp(`(${query})`, '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();
        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();
        const query = event.detail.value;

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

        this.isLoading = true;
        const q = query.toLowerCase();

        setTimeout(() => {
          this.isLoading = false;
          this.visibleOptions = ALL_OPTIONS
            .filter((o) => o.label.toLowerCase().includes(q))
            .map((o) => ({
              ...o,
              label: o.label.replace(new RegExp(`(${query})`, '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) {
      return text.replace(new RegExp(`(${query})`, 'gi'), '<b>$1</b>');
    }

    async function handleInput(event) {
      event.preventDefault();
      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>
    ```
  </CodeGroup>
</CodeLivePreview>

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

<CodeLivePreview
  mode="iframe"
  height="27rem"
  removePadding
  code={`
<style>
body {
  padding: var(--bq-spacing-l);
}

.select-form {
  display: grid;
  gap: var(--bq-spacing-m);
}

.select-form__actions {
  display: flex;
  gap: var(--bq-spacing-s);
  justify-content: flex-end;
}

.select-form__output {
  margin: 0;
  padding: var(--bq-spacing-s);
  border: var(--bq-stroke-s) solid var(--bq-stroke--tertiary);
  border-radius: var(--bq-radius--s);
  background: var(--bq-ui--secondary);
  color: var(--bq-text--primary);
  white-space: pre-wrap;
}
</style>

<form class="select-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>
<div class="select-form__actions">
  <bq-button appearance="secondary" type="reset">Reset</bq-button>
  <bq-button type="button">Submit</bq-button>
</div>
<pre class="select-form__output" id="select-output">{}</pre>
</form>

<script>
(() => {
  const form = previewRoot.querySelector('#select-form');
  const output = previewRoot.querySelector('#select-output');
  const submitButton = form.querySelector('bq-button[type="button"]');

  const showFormData = () => {
    if (!form.reportValidity()) return;
    output.textContent = JSON.stringify(Object.fromEntries(new FormData(form).entries()), null, 2);
  };

  submitButton?.addEventListener('bqClick', (event) => {
    event.preventDefault();
    showFormData();
  });

  form.addEventListener('submit', (event) => {
    event.preventDefault();
    showFormData();
  });

  form.addEventListener('reset', () => {
    requestAnimationFrame(() => {
      output.textContent = '{}';
    });
  });
})();
</script>
`}
>
  <CodeGroup>
    ```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>
    ```
  </CodeGroup>
</CodeLivePreview>

## Best practices

<CardGroup cols={2}>
  <Card>
    <span className="flex items-center mr-2 text-lg font-medium" role="heading">
      <Icon className="mr-2" icon="check" iconType="solid" size={20} color="var(--bq-stroke--success)" />

      Do
    </span>

    Always populate the `label` slot so the select has an accessible name visible to all users, not just those relying on assistive technology.
  </Card>

  <Card>
    <span className="flex items-center mr-2 text-lg font-medium" role="heading">
      <Icon className="mr-2" icon="xmark" iconType="solid" size={20} color="var(--bq-stroke--danger)" />

      Don't
    </span>

    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>

  <Card>
    <span className="flex items-center mr-2 text-lg font-medium" role="heading">
      <Icon className="mr-2" icon="check" iconType="solid" size={20} color="var(--bq-stroke--success)" />

      Do
    </span>

    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>

  <Card>
    <span className="flex items-center mr-2 text-lg font-medium" role="heading">
      <Icon className="mr-2" icon="xmark" iconType="solid" size={20} color="var(--bq-stroke--danger)" />

      Don't
    </span>

    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>

  <Card>
    <span className="flex items-center mr-2 text-lg font-medium" role="heading">
      <Icon className="mr-2" icon="check" iconType="solid" size={20} color="var(--bq-stroke--success)" />

      Do
    </span>

    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>

  <Card>
    <span className="flex items-center mr-2 text-lg font-medium" role="heading">
      <Icon className="mr-2" icon="xmark" iconType="solid" size={20} color="var(--bq-stroke--danger)" />

      Don't
    </span>

    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>

  <Card>
    <span className="flex items-center mr-2 text-lg font-medium" role="heading">
      <Icon className="mr-2" icon="check" iconType="solid" size={20} color="var(--bq-stroke--success)" />

      Do
    </span>

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

  <Card>
    <span className="flex items-center mr-2 text-lg font-medium" role="heading">
      <Icon className="mr-2" icon="xmark" iconType="solid" size={20} color="var(--bq-stroke--danger)" />

      Don't
    </span>

    Use internal codes, abbreviations, or IDs as the visible option labels — what is meaningful in your database is not necessarily meaningful to users.
  </Card>
</CardGroup>

## Accessibility

* **Built in:** the native `<input>` inside the control has `role="combobox"`, `aria-haspopup="listbox"`, `aria-expanded` (toggled when the panel opens and closes), and `aria-controls` pointing to the `bq-option-list` 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:** keyboard navigation — `Tab` moves focus to the input; `Enter` / `Space` opens the panel; `ArrowDown` / `ArrowUp` move between options; `Enter` selects the focused option; `Escape` closes the panel.
* **Built in:** in multi-select mode, `Backspace` on an empty input removes the most recently added tag.
* **Your responsibility:** always provide a visible label via the `label` slot. The `aria-labelledby` on the combobox role relies on the label element being present.
* **Your responsibility:** when `validation-status` is `"error"`, populate the `helper-text` slot with a clear error description so `aria-describedby` can link the input to the explanation.
* **Your responsibility:** if options are loaded asynchronously, provide a loading indicator in the panel slot so users know content is arriving.

## 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                                     | `number`                                                                                                                                                             | `0`             |
| `disableClear`          | `disable-clear`           | If `true`, the clear button is hidden                                                           | `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`             |
| `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`                | If `true`, the option list cannot be opened or filtered                                         | `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[]`                                                                                                                                                 | —               |

### 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 the Select input loses focus                                                                               |
| `bqClear`  | Emitted when the selected value has been cleared                                                                        |
| `bqFocus`  | Emitted when the Select input receives focus                                                                            |
| `bqInput`  | Emitted when the input value changes while typing; detail is `{ value: string \| number \| string[] }`                  |
| `bqSelect` | Emitted when the selected value changes; detail is `{ value: string \| number \| string[]; item: HTMLBqOptionElement }` |

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

<Expandable title="CSS variables" defaultOpen={false}>
  | 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-disabled`  | Select border color when disabled                 | —                                                            |
  | `--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-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)`                                  |
</Expandable>

<Tip>
  Learn more about [styling with shadow parts](/guides/styles#component-shadow-dom-parts) and [CSS custom properties](/guides/styles#global-css-custom-properties).
</Tip>

## Resources

<CardGroup cols={2}>
  <Card horizontal title="Interactive playground" icon="code" href="https://storybook.beeq.design/?path=/story/components-select--default">
    Explore Select variants and states in Storybook
  </Card>

  <Card horizontal title="Source code" icon="github" href="https://github.com/Endava/BEEQ/tree/main/packages/beeq/src/components/select">
    View the component source on GitHub
  </Card>
</CardGroup>
