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

# Tag

> Tags are concise elements that let users input information, make selections, filter content, or initiate actions within a user interface.

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>;
};

<Frame className="px-4 py-4" caption="Tag component overview">
  <img className="block dark:hidden" src="https://mintcdn.com/beeq/wg4EwK5G4l2plt8W/components/images/tag/tag-overview-light.svg?fit=max&auto=format&n=wg4EwK5G4l2plt8W&q=85&s=419225bd0575443963ea390cfd630c55" alt="BEEQ Tag component overview" width="505" height="288" data-path="components/images/tag/tag-overview-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/beeq/wg4EwK5G4l2plt8W/components/images/tag/tag-overview-dark.svg?fit=max&auto=format&n=wg4EwK5G4l2plt8W&q=85&s=478009d524603d5f0c0d27d33f848d57" alt="BEEQ Tag component overview" width="505" height="288" data-path="components/images/tag/tag-overview-dark.svg" />
</Frame>

Tags are concise elements that let users input information, make selections, filter content, or initiate actions within a user interface. Use them to label items with keywords or categories so content is easier to find, organize, and manage.

<Note>
  Tags can be purely informational, clickable, or removable. Icons can support the meaning of a tag, but they cannot replace the text label as the only content.
</Note>

## 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 tags when
    </span>

    * You need to label or categorize items, content, or metadata
    * Users should be able to scan keywords, categories, or attributes quickly
    * The UI needs compact filters, suggestion chips, or removable selections
    * A short, structured label is enough to communicate the meaning
  </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 tags when
    </span>

    * The content requires long explanations or sentence-length text
    * The information would be clearer as a button, badge, or full filter panel
    * The tag would obstruct important content or crowd the layout
    * The meaning depends on an icon alone without a readable text label
  </Card>
</CardGroup>

## Patterns

The design guidance highlights several common ways tags can appear in an interface.

<CardGroup cols={2}>
  <Card title="Default">
    The default tag includes a text label, which is mandatory. Labels should be succinct and clearly communicate their purpose.
  </Card>

  <Card title="Default with icon">
    An optional icon may be positioned to the left of the tag label to provide extra context or emphasis.
  </Card>

  <Card title="Removable">
    A removable tag allows users to selectively manage or remove items as needed, making it useful in dynamic filtering and selection flows.
  </Card>

  <Card title="Removable with icon">
    A removable tag can also include a leading icon when users need both quick visual context and the ability to clear the tag.
  </Card>

  <Card title="Colored">
    A colored tag helps highlight or differentiate categories, types, or states within an interface.
  </Card>
</CardGroup>

<Note>
  Tags serve four functional roles: **input** (user-entered keywords or values), **suggestion** (pre-defined hints offered based on context), **filter** (applied search or browse criteria shown as chips), and **assist** (read-only context chips alongside content). Choose the visual pattern — informational, clickable, or removable — to match the functional role.
</Note>

## Anatomy

<Frame className="px-4 py-4" caption="Tag component anatomy">
  <img className="block dark:hidden" src="https://mintcdn.com/beeq/wg4EwK5G4l2plt8W/components/images/tag/tag-anatomy-light.svg?fit=max&auto=format&n=wg4EwK5G4l2plt8W&q=85&s=ddc253a5be6d1fd670391dd93453aa52" alt="BEEQ Tag component anatomy" width="221" height="119" data-path="components/images/tag/tag-anatomy-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/beeq/wg4EwK5G4l2plt8W/components/images/tag/tag-anatomy-dark.svg?fit=max&auto=format&n=wg4EwK5G4l2plt8W&q=85&s=1c03b5e3c62dfdc06e3ca98d1ad880d5" alt="BEEQ Tag component anatomy" width="221" height="119" data-path="components/images/tag/tag-anatomy-dark.svg" />
</Frame>

A tag can include a text label, optional prefix content, and an optional close action when removable. The text remains the primary communicator.

| Part  | Element      | Description                                     |
| ----- | ------------ | ----------------------------------------------- |
| **1** | Wrapper      | The main visual container of the tag            |
| **2** | Prefix       | Optional icon or content placed before the text |
| **3** | Text         | The visible label of the tag                    |
| **4** | Close button | Optional action used to remove the tag          |

## Design guidelines

Use tags with restraint so they help users scan and act without turning into visual noise.

<Steps>
  <Step title="Choose the role">
    Start by deciding whether the tag is informational, clickable, or removable. Each behavior changes what users expect when they interact with it.
  </Step>

  <Step title="Choose the size">
    Use `medium` tags when the label needs more prominence, `small` for secondary metadata, and `xsmall` only when space is tight and the text can stay readable.
  </Step>

  <Step title="Choose the emphasis">
    Prefer neutral tags by default. Add color only when it helps people distinguish categories, states, or selected values faster.
  </Step>
</Steps>

<Note>
  Keep tag labels short, ideally one or two words or roughly no more than 20 characters, so the tag remains scannable.
</Note>

## Usage

### Default

Use the standard tag when you want a simple and clean representation.

<CodeLivePreview mode="shadow" code={`<bq-tag>Tag</bq-tag>`}>
  <CodeGroup>
    ```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-tag>Tag</bq-tag>
    ```

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

    <BqTag>Tag</BqTag>
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqTag],
      template: `
        <bq-tag>Tag</bq-tag>
      `,
    })
    export class AppComponent {}
    ```

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

    <template>
      <BqTag>Tag</BqTag>
    </template>
    ```
  </CodeGroup>
</CodeLivePreview>

### Size

Adjust the `size` attribute to customize the tag's dimensions and support a clearer visual hierarchy.

<CodeLivePreview
  mode="shadow"
  code={`
<bq-tag size="xsmall">Extra small</bq-tag>
<bq-tag size="small">Small</bq-tag>
<bq-tag size="medium">Medium</bq-tag>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-tag size="xsmall">Extra small</bq-tag>
    <bq-tag size="small">Small</bq-tag>
    <bq-tag size="medium">Medium</bq-tag>
    ```

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

    <>
      <BqTag size="xsmall">Extra small</BqTag>
      <BqTag size="small">Small</BqTag>
      <BqTag size="medium">Medium</BqTag>
    </>
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqTag],
      template: `
        <bq-tag size="xsmall">Extra small</bq-tag>
        <bq-tag size="small">Small</bq-tag>
        <bq-tag size="medium">Medium</bq-tag>
      `,
    })
    export class AppComponent {}
    ```

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

    <template>
      <BqTag size="xsmall">Extra small</BqTag>
      <BqTag size="small">Small</BqTag>
      <BqTag size="medium">Medium</BqTag>
    </template>
    ```
  </CodeGroup>
</CodeLivePreview>

### Clickable

Apply the `clickable` attribute for interactive tags that can trigger actions or toggle selection.

<CodeLivePreview
  mode="shadow"
  code={`
<bq-tag clickable>Tag</bq-tag>
<bq-tag clickable selected>Tag</bq-tag>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-tag clickable>Tag</bq-tag>
    <bq-tag clickable selected>Tag</bq-tag>
    ```

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

    <>
      <BqTag clickable>Tag</BqTag>
      <BqTag clickable selected>Tag</BqTag>
    </>
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqTag],
      template: `
        <bq-tag clickable>Tag</bq-tag>
        <bq-tag clickable selected>Tag</bq-tag>
      `,
    })
    export class AppComponent {}
    ```

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

    <template>
      <BqTag clickable>Tag</BqTag>
      <BqTag clickable selected>Tag</BqTag>
    </template>
    ```
  </CodeGroup>
</CodeLivePreview>

### Disabled

Apply `disabled` alongside `clickable` when a tag action is temporarily unavailable. The `disabled` attribute has no effect on informational or removable tags.

<CodeLivePreview
  mode="shadow"
  code={`
<bq-tag clickable>Enabled</bq-tag>
<bq-tag clickable disabled>Disabled</bq-tag>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-tag clickable>Enabled</bq-tag>
    <bq-tag clickable disabled>Disabled</bq-tag>
    ```

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

    <>
      <BqTag clickable>Enabled</BqTag>
      <BqTag clickable disabled>Disabled</BqTag>
    </>
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqTag],
      template: `
        <bq-tag clickable>Enabled</bq-tag>
        <bq-tag clickable disabled>Disabled</bq-tag>
      `,
    })
    export class AppComponent {}
    ```

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

    <template>
      <BqTag clickable>Enabled</BqTag>
      <BqTag clickable disabled>Disabled</BqTag>
    </template>
    ```
  </CodeGroup>
</CodeLivePreview>

## Options

### Color - filled

Use filled colored tags when you want a stronger visual distinction for categories or states.

<CodeLivePreview
  mode="shadow"
  code={`
<bq-tag color="success">Success</bq-tag>
<bq-tag color="info">Info</bq-tag>
<bq-tag color="error">Error</bq-tag>
<bq-tag color="warning">Warning</bq-tag>
<bq-tag color="gray">Gray</bq-tag>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-tag color="success">Success</bq-tag>
    <bq-tag color="info">Info</bq-tag>
    <bq-tag color="error">Error</bq-tag>
    <bq-tag color="warning">Warning</bq-tag>
    <bq-tag color="gray">Gray</bq-tag>
    ```

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

    <BqTag color="success">Success</BqTag>
    <BqTag color="info">Info</BqTag>
    <BqTag color="error">Error</BqTag>
    <BqTag color="warning">Warning</BqTag>
    <BqTag color="gray">Gray</BqTag>
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqTag],
      template: `
        <bq-tag color="success">Success</bq-tag>
        <bq-tag color="info">Info</bq-tag>
        <bq-tag color="error">Error</bq-tag>
        <bq-tag color="warning">Warning</bq-tag>
        <bq-tag color="gray">Gray</bq-tag>
      `,
    })
    export class AppComponent {}
    ```

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

    <template>
      <BqTag color="success">Success</BqTag>
      <BqTag color="info">Info</BqTag>
      <BqTag color="error">Error</BqTag>
      <BqTag color="warning">Warning</BqTag>
      <BqTag color="gray">Gray</BqTag>
    </template>
    ```
  </CodeGroup>
</CodeLivePreview>

### Color - outline

Use `variant="outline"` when you want a subtler visual distinction without a filled surface.

<CodeLivePreview
  mode="shadow"
  code={`
<bq-tag color="success" variant="outline">Success</bq-tag>
<bq-tag color="info" variant="outline">Info</bq-tag>
<bq-tag color="error" variant="outline">Error</bq-tag>
<bq-tag color="warning" variant="outline">Warning</bq-tag>
<bq-tag color="gray" variant="outline">Gray</bq-tag>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-tag color="success" variant="outline">Success</bq-tag>
    <bq-tag color="info" variant="outline">Info</bq-tag>
    <bq-tag color="error" variant="outline">Error</bq-tag>
    <bq-tag color="warning" variant="outline">Warning</bq-tag>
    <bq-tag color="gray" variant="outline">Gray</bq-tag>
    ```

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

    <BqTag color="success" variant="outline">Success</BqTag>
    <BqTag color="info" variant="outline">Info</BqTag>
    <BqTag color="error" variant="outline">Error</BqTag>
    <BqTag color="warning" variant="outline">Warning</BqTag>
    <BqTag color="gray" variant="outline">Gray</BqTag>
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqTag],
      template: `
        <bq-tag color="success" variant="outline">Success</bq-tag>
        <bq-tag color="info" variant="outline">Info</bq-tag>
        <bq-tag color="error" variant="outline">Error</bq-tag>
        <bq-tag color="warning" variant="outline">Warning</bq-tag>
        <bq-tag color="gray" variant="outline">Gray</bq-tag>
      `,
    })
    export class AppComponent {}
    ```

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

    <template>
      <BqTag color="success" variant="outline">Success</BqTag>
      <BqTag color="info" variant="outline">Info</BqTag>
      <BqTag color="error" variant="outline">Error</BqTag>
      <BqTag color="warning" variant="outline">Warning</BqTag>
      <BqTag color="gray" variant="outline">Gray</BqTag>
    </template>
    ```
  </CodeGroup>
</CodeLivePreview>

### Removable - filled

Enable `removable` when users need to clear selected items, applied filters, or entered values.

<CodeLivePreview
  mode="shadow"
  code={`
<bq-tag removable>Default</bq-tag>
<bq-tag removable color="success">Success</bq-tag>
<bq-tag removable color="info">Info</bq-tag>
<bq-tag removable color="error">Error</bq-tag>
<bq-tag removable color="warning">Warning</bq-tag>
<bq-tag removable color="gray">Gray</bq-tag>

<script>
(() => {
  previewRoot.querySelectorAll('bq-tag[removable]').forEach((tag) => {
    tag.addEventListener('bqClose', () => {
      window.setTimeout(() => tag.show(), 1500);
    });
  });
})();
</script>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-tag removable>Default</bq-tag>
    <bq-tag removable color="success">Success</bq-tag>
    <bq-tag removable color="info">Info</bq-tag>
    <bq-tag removable color="error">Error</bq-tag>
    <bq-tag removable color="warning">Warning</bq-tag>
    <bq-tag removable color="gray">Gray</bq-tag>
    ```

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

    <BqTag removable>Default</BqTag>
    <BqTag removable color="success">Success</BqTag>
    <BqTag removable color="info">Info</BqTag>
    <BqTag removable color="error">Error</BqTag>
    <BqTag removable color="warning">Warning</BqTag>
    <BqTag removable color="gray">Gray</BqTag>
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqTag],
      template: `
        <bq-tag removable>Default</bq-tag>
        <bq-tag removable color="success">Success</bq-tag>
        <bq-tag removable color="info">Info</bq-tag>
        <bq-tag removable color="error">Error</bq-tag>
        <bq-tag removable color="warning">Warning</bq-tag>
        <bq-tag removable color="gray">Gray</bq-tag>
      `,
    })
    export class AppComponent {}
    ```

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

    <template>
      <BqTag removable>Default</BqTag>
      <BqTag removable color="success">Success</BqTag>
      <BqTag removable color="info">Info</BqTag>
      <BqTag removable color="error">Error</BqTag>
      <BqTag removable color="warning">Warning</BqTag>
      <BqTag removable color="gray">Gray</BqTag>
    </template>
    ```
  </CodeGroup>
</CodeLivePreview>

### Removable - outline

Use `variant="outline"` with `removable` when you want the same close behavior with lower visual weight.

<CodeLivePreview
  mode="shadow"
  code={`
<bq-tag removable variant="outline">Default</bq-tag>
<bq-tag removable color="success" variant="outline">Success</bq-tag>
<bq-tag removable color="info" variant="outline">Info</bq-tag>
<bq-tag removable color="error" variant="outline">Error</bq-tag>
<bq-tag removable color="warning" variant="outline">Warning</bq-tag>
<bq-tag removable color="gray" variant="outline">Gray</bq-tag>
<script>
(() => {
  previewRoot.querySelectorAll('bq-tag[removable]').forEach((tag) => {
    tag.addEventListener('bqClose', () => {
      window.setTimeout(() => tag.show(), 1500);
    });
  });
})();
</script>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-tag removable variant="outline">Default</bq-tag>
    <bq-tag removable color="success" variant="outline">Success</bq-tag>
    <bq-tag removable color="info" variant="outline">Info</bq-tag>
    <bq-tag removable color="error" variant="outline">Error</bq-tag>
    <bq-tag removable color="warning" variant="outline">Warning</bq-tag>
    <bq-tag removable color="gray" variant="outline">Gray</bq-tag>
    ```

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

    <BqTag removable variant="outline">Default</BqTag>
    <BqTag removable color="success" variant="outline">Success</BqTag>
    <BqTag removable color="info" variant="outline">Info</BqTag>
    <BqTag removable color="error" variant="outline">Error</BqTag>
    <BqTag removable color="warning" variant="outline">Warning</BqTag>
    <BqTag removable color="gray" variant="outline">Gray</BqTag>
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqTag],
      template: `
        <bq-tag removable variant="outline">Default</bq-tag>
        <bq-tag removable color="success" variant="outline">Success</bq-tag>
        <bq-tag removable color="info" variant="outline">Info</bq-tag>
        <bq-tag removable color="error" variant="outline">Error</bq-tag>
        <bq-tag removable color="warning" variant="outline">Warning</bq-tag>
        <bq-tag removable color="gray" variant="outline">Gray</bq-tag>
      `,
    })
    export class AppComponent {}
    ```

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

    <template>
      <BqTag removable variant="outline">Default</BqTag>
      <BqTag removable color="success" variant="outline">Success</BqTag>
      <BqTag removable color="info" variant="outline">Info</BqTag>
      <BqTag removable color="error" variant="outline">Error</BqTag>
      <BqTag removable color="warning" variant="outline">Warning</BqTag>
      <BqTag removable color="gray" variant="outline">Gray</BqTag>
    </template>
    ```
  </CodeGroup>
</CodeLivePreview>

### Prefix - filled

Use the `prefix` slot to add an icon when extra context helps, while keeping the text label as the main content.

<CodeLivePreview
  mode="shadow"
  code={`
<bq-tag>
<bq-icon name="alarm" slot="prefix"></bq-icon>
Default
</bq-tag>
<bq-tag color="success">
<bq-icon name="check-circle" slot="prefix"></bq-icon>
Success
</bq-tag>
<bq-tag color="info">
<bq-icon name="info" slot="prefix"></bq-icon>
Info
</bq-tag>
<bq-tag color="error">
<bq-icon name="warning-diamond" slot="prefix"></bq-icon>
Error
</bq-tag>
<bq-tag color="warning">
<bq-icon name="warning" slot="prefix"></bq-icon>
Warning
</bq-tag>
<bq-tag color="gray">
<bq-icon name="video-camera-slash" slot="prefix"></bq-icon>
Gray
</bq-tag>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-tag>
      <bq-icon name="alarm" slot="prefix"></bq-icon>
      Default
    </bq-tag>
    <bq-tag color="success">
      <bq-icon name="check-circle" slot="prefix"></bq-icon>
      Success
    </bq-tag>
    <bq-tag color="info">
      <bq-icon name="info" slot="prefix"></bq-icon>
      Info
    </bq-tag>
    <bq-tag color="error">
      <bq-icon name="warning-diamond" slot="prefix"></bq-icon>
      Error
    </bq-tag>
    <bq-tag color="warning">
      <bq-icon name="warning" slot="prefix"></bq-icon>
      Warning
    </bq-tag>
    <bq-tag color="gray">
      <bq-icon name="video-camera-slash" slot="prefix"></bq-icon>
      Gray
    </bq-tag>
    ```

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

    <BqTag>
      <BqIcon name="alarm" slot="prefix" />
      Default
    </BqTag>
    <BqTag color="success">
      <BqIcon name="check-circle" slot="prefix" />
      Success
    </BqTag>
    <BqTag color="info">
      <BqIcon name="info" slot="prefix" />
      Info
    </BqTag>
    <BqTag color="error">
      <BqIcon name="warning-diamond" slot="prefix" />
      Error
    </BqTag>
    <BqTag color="warning">
      <BqIcon name="warning" slot="prefix" />
      Warning
    </BqTag>
    <BqTag color="gray">
      <BqIcon name="video-camera-slash" slot="prefix" />
      Gray
    </BqTag>
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqTag, BqIcon],
      template: `
        <bq-tag>
          <bq-icon name="alarm" slot="prefix"></bq-icon>
          Default
        </bq-tag>
        <bq-tag color="success">
          <bq-icon name="check-circle" slot="prefix"></bq-icon>
          Success
        </bq-tag>
        <bq-tag color="info">
          <bq-icon name="info" slot="prefix"></bq-icon>
          Info
        </bq-tag>
        <bq-tag color="error">
          <bq-icon name="warning-diamond" slot="prefix"></bq-icon>
          Error
        </bq-tag>
        <bq-tag color="warning">
          <bq-icon name="warning" slot="prefix"></bq-icon>
          Warning
        </bq-tag>
        <bq-tag color="gray">
          <bq-icon name="video-camera-slash" slot="prefix"></bq-icon>
          Gray
        </bq-tag>
      `,
    })
    export class AppComponent {}
    ```

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

    <template>
      <BqTag>
        <BqIcon name="alarm" slot="prefix" />
        Default
      </BqTag>
      <BqTag color="success">
        <BqIcon name="check-circle" slot="prefix" />
        Success
      </BqTag>
      <BqTag color="info">
        <BqIcon name="info" slot="prefix" />
        Info
      </BqTag>
      <BqTag color="error">
        <BqIcon name="warning-diamond" slot="prefix" />
        Error
      </BqTag>
      <BqTag color="warning">
        <BqIcon name="warning" slot="prefix" />
        Warning
      </BqTag>
      <BqTag color="gray">
        <BqIcon name="video-camera-slash" slot="prefix" />
        Gray
      </BqTag>
    </template>
    ```
  </CodeGroup>
</CodeLivePreview>

### Prefix - outline

Use the outline variant with a prefix icon when you want context with a lighter visual treatment.

<CodeLivePreview
  mode="shadow"
  code={`
<bq-tag variant="outline">
<bq-icon name="alarm" slot="prefix"></bq-icon>
Default
</bq-tag>
<bq-tag color="success" variant="outline">
<bq-icon name="check-circle" slot="prefix"></bq-icon>
Success
</bq-tag>
<bq-tag color="info" variant="outline">
<bq-icon name="info" slot="prefix"></bq-icon>
Info
</bq-tag>
<bq-tag color="error" variant="outline">
<bq-icon name="warning-diamond" slot="prefix"></bq-icon>
Error
</bq-tag>
<bq-tag color="warning" variant="outline">
<bq-icon name="warning" slot="prefix"></bq-icon>
Warning
</bq-tag>
<bq-tag color="gray" variant="outline">
<bq-icon name="video-camera-slash" slot="prefix"></bq-icon>
Gray
</bq-tag>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-tag variant="outline">
      <bq-icon name="alarm" slot="prefix"></bq-icon>
      Default
    </bq-tag>
    <bq-tag color="success" variant="outline">
      <bq-icon name="check-circle" slot="prefix"></bq-icon>
      Success
    </bq-tag>
    <bq-tag color="info" variant="outline">
      <bq-icon name="info" slot="prefix"></bq-icon>
      Info
    </bq-tag>
    <bq-tag color="error" variant="outline">
      <bq-icon name="warning-diamond" slot="prefix"></bq-icon>
      Error
    </bq-tag>
    <bq-tag color="warning" variant="outline">
      <bq-icon name="warning" slot="prefix"></bq-icon>
      Warning
    </bq-tag>
    <bq-tag color="gray" variant="outline">
      <bq-icon name="video-camera-slash" slot="prefix"></bq-icon>
      Gray
    </bq-tag>
    ```

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

    <BqTag variant="outline">
      <BqIcon name="alarm" slot="prefix" />
      Default
    </BqTag>
    <BqTag color="success" variant="outline">
      <BqIcon name="check-circle" slot="prefix" />
      Success
    </BqTag>
    <BqTag color="info" variant="outline">
      <BqIcon name="info" slot="prefix" />
      Info
    </BqTag>
    <BqTag color="error" variant="outline">
      <BqIcon name="warning-diamond" slot="prefix" />
      Error
    </BqTag>
    <BqTag color="warning" variant="outline">
      <BqIcon name="warning" slot="prefix" />
      Warning
    </BqTag>
    <BqTag color="gray" variant="outline">
      <BqIcon name="video-camera-slash" slot="prefix" />
      Gray
    </BqTag>
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqTag, BqIcon],
      template: `
        <bq-tag variant="outline">
          <bq-icon name="alarm" slot="prefix"></bq-icon>
          Default
        </bq-tag>
        <bq-tag color="success" variant="outline">
          <bq-icon name="check-circle" slot="prefix"></bq-icon>
          Success
        </bq-tag>
        <bq-tag color="info" variant="outline">
          <bq-icon name="info" slot="prefix"></bq-icon>
          Info
        </bq-tag>
        <bq-tag color="error" variant="outline">
          <bq-icon name="warning-diamond" slot="prefix"></bq-icon>
          Error
        </bq-tag>
        <bq-tag color="warning" variant="outline">
          <bq-icon name="warning" slot="prefix"></bq-icon>
          Warning
        </bq-tag>
        <bq-tag color="gray" variant="outline">
          <bq-icon name="video-camera-slash" slot="prefix"></bq-icon>
          Gray
        </bq-tag>
      `,
    })
    export class AppComponent {}
    ```

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

    <template>
      <BqTag variant="outline">
        <BqIcon name="alarm" slot="prefix" />
        Default
      </BqTag>
      <BqTag color="success" variant="outline">
        <BqIcon name="check-circle" slot="prefix" />
        Success
      </BqTag>
      <BqTag color="info" variant="outline">
        <BqIcon name="info" slot="prefix" />
        Info
      </BqTag>
      <BqTag color="error" variant="outline">
        <BqIcon name="warning-diamond" slot="prefix" />
        Error
      </BqTag>
      <BqTag color="warning" variant="outline">
        <BqIcon name="warning" slot="prefix" />
        Warning
      </BqTag>
      <BqTag color="gray" variant="outline">
        <BqIcon name="video-camera-slash" slot="prefix" />
        Gray
      </BqTag>
    </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>

    Position tags where they remain visible and accessible without obstructing important content or interactions.
  </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>

    Don't use sentence-length labels or dense technical wording inside tags.
  </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 visually distinct styles and colors to differentiate types of tags when those distinctions help users.
  </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>

    Don't rely on an icon alone. A tag still needs a clear text label.
  </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>

    Make interactive tags easy to use, whether the goal is to click, toggle, or remove them.
  </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>

    Don't mix too many colors or tag styles in the same area. Limit color use to a single semantic purpose — more than one color scheme in a single list forces users to decode two systems at once.
  </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>

    Group tags in a meaningful set when they work as filters, suggestions, or applied selections so users can compare them quickly.
  </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>

    Don't display a single standalone tag. Tags gain meaning through comparison — use a set of at least three before reaching for this component, otherwise a plain label or a different component will communicate the same thing more clearly.
  </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>

    Reserve removable tags for low-stakes selections like applied filters or entered keywords, where removing the tag is easy to undo.
  </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>

    Don't use removable tags for critical or destructive actions. A close button is easy to tap accidentally — use an explicit button or a confirmation dialog for consequential operations.
  </Card>
</CardGroup>

<Warning>
  The `disabled` prop only takes effect when `clickable` is also set. Disabling an informational or removable tag has no visual or behavioral impact.
</Warning>

## Accessibility

* Built in: when a tag is clickable, the component renders a native `button` in the shadow DOM, not a generic `div`, so keyboard and button semantics work by default.
* Built in: when a clickable tag is disabled, the internal button receives `disabled` and no click, focus, or blur behavior is emitted.
* Built in: when a removable tag is closed, the host reflects `hidden` and `aria-hidden`, and the close action is exposed through a button labeled `Close`.
* Built in: decorative close icons are marked `aria-hidden="true"` so assistive technology reads the button label instead of the icon name.
* You must: keep text as the primary content. Prefix icons can reinforce meaning, but they should never replace the visible label.
* You must: avoid relying on color alone for category or state. The label should still make sense without the visual treatment.
* You must: make the effect of removing a tag obvious in the surrounding UI, especially in filters and selected-value patterns.

## API reference

### Properties

| Property    | Attribute   | Description                                                           | Type                                                                 | Default     |
| ----------- | ----------- | --------------------------------------------------------------------- | -------------------------------------------------------------------- | ----------- |
| `border`    | `border`    | The corner radius of the Tag (will override size's predefined border) | `'none'` \| `'xs2'` \| `'xs'` \| `'s'` \| `'m'` \| `'l'` \| `'full'` | `undefined` |
| `clickable` | `clickable` | If `true`, the Tag can be clickable                                   | `boolean`                                                            | `false`     |
| `color`     | `color`     | The color style of the Tag                                            | `'error'` \| `'gray'` \| `'info'` \| `'success'` \| `'warning'`      | `undefined` |
| `disabled`  | `disabled`  | If `true`, the Tag will be disabled (only if clickable)               | `boolean`                                                            | `false`     |
| `hidden`    | `hidden`    | If `true`, the Tag component will be hidden                           | `boolean`                                                            | `undefined` |
| `removable` | `removable` | If `true`, the Tag component can be removed                           | `boolean`                                                            | `false`     |
| `selected`  | `selected`  | If `true`, the Tag is selected (only if clickable)                    | `boolean`                                                            | `false`     |
| `size`      | `size`      | The size of the Tag component                                         | `'xsmall'` \| `'small'` \| `'medium'`                                | `'medium'`  |
| `variant`   | `variant`   | The visual variant of the Tag                                         | `'filled'` \| `'outline'`                                            | `'filled'`  |

### Events

| Event     | Description                                     | Type                            |
| --------- | ----------------------------------------------- | ------------------------------- |
| `bqBlur`  | Fires when the tag loses focus                  | `CustomEvent<HTMLBqTagElement>` |
| `bqClick` | Fires when the tag is clicked                   | `CustomEvent<HTMLBqTagElement>` |
| `bqClose` | Fires when a removable tag is closed and hidden | `CustomEvent<HTMLBqTagElement>` |
| `bqFocus` | Fires when the tag receives focus               | `CustomEvent<HTMLBqTagElement>` |
| `bqOpen`  | Fires when a removable tag is shown again       | `CustomEvent<HTMLBqTagElement>` |

<Note>
  * In React, prefix events with `on`: `onBqBlur`, `onBqClick`, `onBqClose`, `onBqFocus`, `onBqOpen`.
  * In Angular, use the event binding syntax: `(bqBlur)`, `(bqClick)`, `(bqClose)`, `(bqFocus)`, `(bqOpen)`.
  * In Vue, use the `@` shorthand with camelCase: `@bqBlur`, `@bqClick`, `@bqClose`, `@bqFocus`, `@bqOpen`.
  * `preventDefault()` is supported on `bqClick`, `bqClose`, and `bqOpen`. Calling it cancels the default toggle, hide, or show behavior after the event fires.
</Note>

### Methods

| Method   | Description                                  | Signature                 |
| -------- | -------------------------------------------- | ------------------------- |
| `hide()` | Programmatically hides a removable tag       | `hide() => Promise<void>` |
| `show()` | Programmatically shows a removable tag again | `show() => Promise<void>` |

### Slots

| Slot        | Description                       |
| ----------- | --------------------------------- |
| *(default)* | The text content of the tag       |
| `prefix`    | Content displayed before the text |

### Shadow parts

| Part        | Description                                   |
| ----------- | --------------------------------------------- |
| `wrapper`   | The wrapper container inside the shadow DOM   |
| `prefix`    | The prefix container when icon content exists |
| `text`      | The element containing the tag text           |
| `btn-close` | The close button used to remove the tag       |

### CSS custom properties

<Expandable title="CSS variables" defaultOpen={true}>
  | Variable                        | Description                   | Default                                                     |
  | ------------------------------- | ----------------------------- | ----------------------------------------------------------- |
  | `--bq-tag--background-color`    | Tag background color          | `var(--bq-ui--secondary)`                                   |
  | `--bq-tag--border-color`        | Tag border color              | `transparent`                                               |
  | `--bq-tag--border-radius`       | Tag border radius             | `var(--bq-radius--s)`                                       |
  | `--bq-tag--border-style`        | Tag border style              | `solid`                                                     |
  | `--bq-tag--border-width`        | Tag border width              | `var(--bq-stroke-s)`                                        |
  | `--bq-tag--small-border-radius` | Small tag border radius       | `var(--bq-radius--xs)`                                      |
  | `--bq-tag--small-gap`           | Small tag content gap         | `var(--bq-spacing-xs2)`                                     |
  | `--bq-tag--small-padding-x`     | Small tag horizontal padding  | `calc(var(--bq-spacing-xs) - var(--bq-tag--border-width))`  |
  | `--bq-tag--small-padding-y`     | Small tag vertical padding    | `calc(var(--bq-spacing-xs3) - var(--bq-tag--border-width))` |
  | `--bq-tag--medium-gap`          | Medium tag content gap        | `var(--bq-spacing-xs)`                                      |
  | `--bq-tag--medium-padding-x`    | Medium tag horizontal padding | `calc(var(--bq-spacing-s) - var(--bq-tag--border-width))`   |
  | `--bq-tag--medium-padding-y`    | Medium tag vertical padding   | `calc(var(--bq-spacing-xs2) - var(--bq-tag--border-width))` |
</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-tag--default">
    Explore tag variants and behaviors in Storybook
  </Card>

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