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

# Dialog

> Dialogs present focused content or decisions that temporarily interrupt the current flow until the user responds or dismisses them.

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="Dialog component overview">
  <img className="block dark:hidden" src="https://mintcdn.com/beeq/nN2FF5Iq6pY7AHlL/components/images/dialog/dialog-overview-light.svg?fit=max&auto=format&n=nN2FF5Iq6pY7AHlL&q=85&s=5c3ed0ae8ac27e33a7822d212e23a7c4" alt="BEEQ Dialog component overview" width="668" height="312" data-path="components/images/dialog/dialog-overview-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/beeq/nN2FF5Iq6pY7AHlL/components/images/dialog/dialog-overview-dark.svg?fit=max&auto=format&n=nN2FF5Iq6pY7AHlL&q=85&s=228fb8f0bfebe23a7e5fe765cfdedcc4" alt="BEEQ Dialog component overview" width="668" height="312" data-path="components/images/dialog/dialog-overview-dark.svg" />
</Frame>

Dialogs keep people in context while they respond to important information, confirm an action, or complete a short focused task. Use them sparingly, only when the interruption is justified.

<Note>
  Keep dialog content concise and purposeful. Always provide a clear way to dismiss the dialog, such as a close button, a cancel action, or both.
</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 dialogs when
    </span>

    * The user must acknowledge or confirm something before continuing
    * A short task or decision should stay in the current page context
    * The content is important enough to temporarily interrupt the flow
  </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 dialogs when
    </span>

    * The content can live inline without blocking the current task
    * The interaction is long, complex, or better suited to a full page
    * The interruption would add friction without adding clarity
  </Card>
</CardGroup>

## Patterns

<CardGroup cols={2}>
  <CardTile title="Standard dialog">
    Use the default dialog to present important information, gather input, or confirm actions in a temporary overlay.
  </CardTile>

  <CardTile title="Confirmation dialog">
    Disable the close button, backdrop dismissal, and `Esc` handling when an irreversible action requires an explicit choice.
  </CardTile>

  <CardTile title="Two actions">
    Use two buttons when the dialog needs a clear primary decision alongside a secondary escape path such as cancel or dismiss.
  </CardTile>

  <CardTile title="Three actions">
    Use three buttons only when users genuinely need a primary, secondary, and tertiary choice within the same decision flow.
  </CardTile>
</CardGroup>

## Anatomy

<Frame className="px-4 py-4" caption="Dialog anatomy">
  <img className="block dark:hidden" src="https://mintcdn.com/beeq/nN2FF5Iq6pY7AHlL/components/images/dialog/dialog-anatomy-light.svg?fit=max&auto=format&n=nN2FF5Iq6pY7AHlL&q=85&s=f8bf1043162a2852d23233c1d5449bbe" alt="Dialog anatomy" width="679" height="320" data-path="components/images/dialog/dialog-anatomy-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/beeq/nN2FF5Iq6pY7AHlL/components/images/dialog/dialog-anatomy-dark.svg?fit=max&auto=format&n=nN2FF5Iq6pY7AHlL&q=85&s=3b89041d665e86502236ae8f11cad323" alt="Dialog anatomy" width="679" height="320" data-path="components/images/dialog/dialog-anatomy-dark.svg" />
</Frame>

A dialog is composed of a container, a header with icon and title, a close control, a body area, and optional footer actions.

| Part  | Element             | Description                                                                   |
| ----- | ------------------- | ----------------------------------------------------------------------------- |
| **1** | Container           | The outer dialog surface that groups all content and actions                  |
| **2** | Header: Icon        | A contextual icon that helps communicate the nature of the dialog at a glance |
| **3** | Header: Title       | The primary heading that explains the purpose of the dialog                   |
| **4** | Close               | The dismiss control shown in the header when the close button is enabled      |
| **5** | Body (description)  | The main content area for supporting text, guidance, or short task content    |
| **6** | Footer: CTA buttons | The action area for the dialog's primary and secondary decisions              |

## Design guidelines

Use dialogs only when the interruption is worth the attention shift and the next step is clear.

<CardGroup cols={2}>
  <CardTile title="Keep the title action-oriented" imageLightSrc="/components/images/dialog/dialog-title-guidance-light.svg" imageDarkSrc="/components/images/dialog/dialog-title-guidance-dark.svg">
    Write titles that tell people what decision or task the dialog is about, not only that something happened.
  </CardTile>

  <CardTile title="Limit the number of actions" imageLightSrc="/components/images/dialog/dialog-actions-guidance-light.svg" imageDarkSrc="/components/images/dialog/dialog-actions-guidance-dark.svg">
    Keep the footer focused. One primary action and one secondary action is usually enough for quick decisions.
  </CardTile>
</CardGroup>

<Steps>
  <Step title="Choose the right level of interruption">
    Use a dialog only when people must pause to confirm, review, or complete a short task before continuing.
  </Step>

  <Step title="Write clear actions">
    Make button labels describe the outcome, especially in destructive or irreversible flows.
  </Step>

  <Step title="Use confirm dialogs carefully">
    Reserve locked-down confirmation dialogs for actions that carry real risk, such as deletion or deactivation.
  </Step>
</Steps>

<Note>
  If the content grows beyond a short decision or focused task, move the interaction to an inline flow or a dedicated page instead of expanding the dialog.
</Note>

## Usage

### Default

Use the `default` dialog when you want to overlay content for focused user engagement.

<CodeLivePreview
  mode="shadow"
  code={`
<style>
h5 {
  display: flex;
  font-weight: 700;
  align-items: center;
  gap: var(--bq-spacing-s);
}

.dialog-footer {
  display: flex;
  gap: var(--bq-spacing-xs);
}
</style>

<bq-button>Open dialog</bq-button>

<bq-dialog>
<h5 slot="title">
  <bq-icon name="info" size="30" color="text--accent" role="img" title="Info"></bq-icon>
  Title
</h5>

<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

<div class="dialog-footer" slot="footer">
  <bq-button appearance="link">Button</bq-button>
  <bq-button variant="ghost">Button</bq-button>
  <bq-button variant="standard">Button</bq-button>
</div>
</bq-dialog>

<script>
(() => {
  const dialog = previewRoot.querySelector('bq-dialog');
  const openButton = previewRoot.querySelector('bq-button');
  if (!dialog || !openButton) return;

  const getNativeDialog = () => dialog.shadowRoot?.querySelector('dialog');
  const openPreviewDialog = () => {
    const nativeDialog = getNativeDialog();
    if (!nativeDialog?.showModal || nativeDialog.open) return;

    dialog.classList.add('bq-dialog--open');
    dialog.open = true;
    nativeDialog.classList.remove('hidden');
    nativeDialog.showModal();
  };

  openButton.addEventListener('bqClick', openPreviewDialog);
})();
</script>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-button>Open dialog</bq-button>

    <bq-dialog>
      <h5 slot="title">
        <bq-icon name="info" size="30" color="text--accent" role="img" title="Info"></bq-icon>
        Title
      </h5>

      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

      <div class="dialog-footer" slot="footer">
        <bq-button appearance="link">Button</bq-button>
        <bq-button variant="ghost">Button</bq-button>
        <bq-button variant="standard">Button</bq-button>
      </div>
    </bq-dialog>

    <script>
      const openDialogBtn = document.querySelector("bq-button");
      const dialogElem = document.querySelector("bq-dialog");

      openDialogBtn.addEventListener("bqClick", () => {
        dialogElem.open = true;
      });
    </script>
    ```

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

    export function DefaultDialog() {
      const dialogRef = useRef(null);

      return (
        <>
          <BqButton onBqClick={() => dialogRef.current?.show()}>Open dialog</BqButton>

          <BqDialog ref={dialogRef}>
            <h5 slot="title">
              <BqIcon name="info" size="30" color="text--accent" role="img" title="Info" />
              Title
            </h5>

            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

            <div className="dialog-footer" slot="footer">
              <BqButton appearance="link">Button</BqButton>
              <BqButton variant="ghost">Button</BqButton>
              <BqButton variant="standard">Button</BqButton>
            </div>
          </BqDialog>
        </>
      );
    }
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqButton, BqDialog, BqIcon],
      template: `
        <bq-button (bqClick)="dialog.show()">Open dialog</bq-button>

        <bq-dialog #dialog>
          <h5 slot="title">
            <bq-icon name="info" size="30" color="text--accent" role="img" title="Info"></bq-icon>
            Title
          </h5>

          <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

          <div class="dialog-footer" slot="footer">
            <bq-button appearance="link">Button</bq-button>
            <bq-button variant="ghost">Button</bq-button>
            <bq-button variant="standard">Button</bq-button>
          </div>
        </bq-dialog>
      `,
    })
    export class AppComponent {}
    ```

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

    const dialogRef = ref(null);
    </script>

    <template>
      <BqButton @bqClick="dialogRef?.show()">Open dialog</BqButton>

      <BqDialog ref="dialogRef">
        <h5 slot="title">
          <BqIcon name="info" size="30" color="text--accent" role="img" title="Info" />
          Title
        </h5>

        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

        <div class="dialog-footer" slot="footer">
          <BqButton appearance="link">Button</BqButton>
          <BqButton variant="ghost">Button</BqButton>
          <BqButton variant="standard">Button</BqButton>
        </div>
      </BqDialog>
    </template>
    ```
  </CodeGroup>
</CodeLivePreview>

<Tip>
  The dialog closes via its built-in close button (✕) or by clicking the backdrop. To control visibility programmatically, call the `show()`, `hide()`, and `cancel()` methods, or use the `open` attribute for static snapshots.
</Tip>

## Options

### Highlight footer

Use `footer-appearance="highlight"` when emphasis on the footer is important.

<CodeLivePreview
  mode="shadow"
  code={`
<style>
h5 {
  display: flex;
  font-weight: 700;
  align-items: center;
  gap: var(--bq-spacing-s);
}

.dialog-footer {
  display: flex;
  gap: var(--bq-spacing-xs);
}
</style>

<bq-button>Open dialog</bq-button>

<bq-dialog footer-appearance="highlight">
<h5 class="bold flex items-center gap-s" slot="title">
  <bq-icon name="info" size="30" color="text--accent" role="img" title="Info"></bq-icon>
  Title
</h5>

<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

<div class="dialog-footer" slot="footer">
  <bq-button appearance="link">Button</bq-button>
  <bq-button variant="ghost">Button</bq-button>
  <bq-button variant="standard">Button</bq-button>
</div>
</bq-dialog>

<script>
(() => {
  const dialog = previewRoot.querySelector('bq-dialog');
  const openButton = previewRoot.querySelector('bq-button');
  if (!dialog || !openButton) return;

  const getNativeDialog = () => dialog.shadowRoot?.querySelector('dialog');
  const openPreviewDialog = () => {
    const nativeDialog = getNativeDialog();
    if (!nativeDialog?.showModal || nativeDialog.open) return;

    dialog.classList.add('bq-dialog--open');
    dialog.open = true;
    nativeDialog.classList.remove('hidden');
    nativeDialog.showModal();
  };

  openButton.addEventListener('bqClick', openPreviewDialog);
})();
</script>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-button>Open dialog</bq-button>

    <bq-dialog footer-appearance="highlight">
      <h5 slot="title">
        <bq-icon name="info" size="30" color="text--accent" role="img" title="Info"></bq-icon>
        Title
      </h5>

      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

      <div class="dialog-footer" slot="footer">
        <bq-button appearance="link">Button</bq-button>
        <bq-button variant="ghost">Button</bq-button>
        <bq-button variant="standard">Button</bq-button>
      </div>
    </bq-dialog>

    <script>
      const openDialogBtn = document.querySelector("bq-button");
      const dialogElem = document.querySelector("bq-dialog");

      openDialogBtn.addEventListener("bqClick", () => {
        dialogElem.open = true;
      });
    </script>
    ```

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

    export function HighlightFooterDialog() {
      const dialogRef = useRef(null);

      return (
        <>
          <BqButton onBqClick={() => dialogRef.current?.show()}>Open dialog</BqButton>

          <BqDialog ref={dialogRef} footerAppearance="highlight">
            <h5 slot="title">
              <BqIcon name="info" size="30" color="text--accent" role="img" title="Info" />
              Title
            </h5>

            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

            <div className="dialog-footer" slot="footer">
              <BqButton appearance="link">Button</BqButton>
              <BqButton variant="ghost">Button</BqButton>
              <BqButton variant="standard">Button</BqButton>
            </div>
          </BqDialog>
        </>
      );
    }
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqButton, BqDialog, BqIcon],
      template: `
        <bq-button (bqClick)="dialog.show()">Open dialog</bq-button>

        <bq-dialog #dialog footer-appearance="highlight">
          <h5 slot="title">
            <bq-icon name="info" size="30" color="text--accent" role="img" title="Info"></bq-icon>
            Title
          </h5>

          <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

          <div class="dialog-footer" slot="footer">
            <bq-button appearance="link">Button</bq-button>
            <bq-button variant="ghost">Button</bq-button>
            <bq-button variant="standard">Button</bq-button>
          </div>
        </bq-dialog>
      `,
    })
    export class AppComponent {}
    ```

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

    const dialogRef = ref(null);
    </script>

    <template>
      <BqButton @bqClick="dialogRef?.show()">Open dialog</BqButton>

      <BqDialog ref="dialogRef" footerAppearance="highlight">
        <h5 slot="title">
          <BqIcon name="info" size="30" color="text--accent" role="img" title="Info" />
          Title
        </h5>

        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

        <div class="dialog-footer" slot="footer">
          <BqButton appearance="link">Button</BqButton>
          <BqButton variant="ghost">Button</BqButton>
          <BqButton variant="standard">Button</BqButton>
        </div>
      </BqDialog>
    </template>
    ```
  </CodeGroup>
</CodeLivePreview>

### No footer

This kind of dialog omits the footer section for situations where a minimal and distraction-free interface is preferred.

<CodeLivePreview
  mode="shadow"
  code={`
<style>
h5 {
  display: flex;
  font-weight: 700;
  align-items: center;
  gap: var(--bq-spacing-s);
}
</style>

<bq-button>Open dialog</bq-button>

<bq-dialog>
<h5 class="bold flex items-center gap-s" slot="title">
  <bq-icon name="info" size="30" color="text--accent" role="img" title="Info"></bq-icon>
  Title
</h5>

<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
</bq-dialog>

<script>
(() => {
  const dialog = previewRoot.querySelector('bq-dialog');
  const openButton = previewRoot.querySelector('bq-button');
  if (!dialog || !openButton) return;

  const getNativeDialog = () => dialog.shadowRoot?.querySelector('dialog');
  const openPreviewDialog = () => {
    const nativeDialog = getNativeDialog();
    if (!nativeDialog?.showModal || nativeDialog.open) return;

    dialog.classList.add('bq-dialog--open');
    dialog.open = true;
    nativeDialog.classList.remove('hidden');
    nativeDialog.showModal();
  };

  openButton.addEventListener('bqClick', openPreviewDialog);
})();
</script>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-button>Open dialog</bq-button>

    <bq-dialog>
      <h5 slot="title">
        <bq-icon name="info" size="30" color="text--accent" role="img" title="Info"></bq-icon>
        Title
      </h5>

      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
    </bq-dialog>

    <script>
      const openDialogBtn = document.querySelector("bq-button");
      const dialogElem = document.querySelector("bq-dialog");

      openDialogBtn.addEventListener("bqClick", () => {
        dialogElem.open = true;
      });
    </script>
    ```

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

    export function NoFooterDialog() {
      const dialogRef = useRef(null);

      return (
        <>
          <BqButton onBqClick={() => dialogRef.current?.show()}>Open dialog</BqButton>

          <BqDialog ref={dialogRef}>
            <h5 slot="title">
              <BqIcon name="info" size="30" color="text--accent" role="img" title="Info" />
              Title
            </h5>

            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
          </BqDialog>
        </>
      );
    }
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqButton, BqDialog, BqIcon],
      template: `
        <bq-button (bqClick)="dialog.show()">Open dialog</bq-button>

        <bq-dialog #dialog>
          <h5 slot="title">
            <bq-icon name="info" size="30" color="text--accent" role="img" title="Info"></bq-icon>
            Title
          </h5>

          <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
        </bq-dialog>
      `,
    })
    export class AppComponent {}
    ```

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

    const dialogRef = ref(null);
    </script>

    <template>
      <BqButton @bqClick="dialogRef?.show()">Open dialog</BqButton>

      <BqDialog ref="dialogRef">
        <h5 slot="title">
          <BqIcon name="info" size="30" color="text--accent" role="img" title="Info" />
          Title
        </h5>

        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
      </BqDialog>
    </template>
    ```
  </CodeGroup>
</CodeLivePreview>

### No backdrop

Use `disable-backdrop` when you want to allow users to focus on the dialog content without an overlay.

<CodeLivePreview
  mode="shadow"
  code={`
<style>
:host {
  position: relative !important;
  z-index: 12 !important;
}

h5 {
  display: flex;
  font-weight: 700;
  align-items: center;
  gap: var(--bq-spacing-s);
}

.dialog-footer {
  display: flex;
  gap: var(--bq-spacing-xs);
}
</style>

<bq-button>Open dialog</bq-button>

<bq-dialog disable-backdrop>
<h5 class="bold flex items-center gap-s" slot="title">
  <bq-icon name="info" size="30" color="text--accent" role="img" title="Info"></bq-icon>
  Title
</h5>

<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

<div class="dialog-footer" slot="footer">
  <bq-button appearance="link">Button</bq-button>
  <bq-button variant="ghost">Button</bq-button>
  <bq-button variant="standard">Button</bq-button>
</div>
</bq-dialog>

<script>
(() => {
  const dialog = previewRoot.querySelector('bq-dialog');
  const openButton = previewRoot.querySelector('bq-button');
  if (!dialog || !openButton) return;

  const getNativeDialog = () => dialog.shadowRoot?.querySelector('dialog');
  const openPreviewDialog = () => {
    const nativeDialog = getNativeDialog();
    if (!nativeDialog?.show || nativeDialog.open) return;

    dialog.classList.add('bq-dialog--open');
    dialog.open = true;
    nativeDialog.classList.remove('hidden');
    nativeDialog.show();
  };

  openButton.addEventListener('bqClick', openPreviewDialog);
})();
</script>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-button>Open dialog</bq-button>

    <bq-dialog disable-backdrop>
      <h5 slot="title">
        <bq-icon name="info" size="30" color="text--accent" role="img" title="Info"></bq-icon>
        Title
      </h5>

      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

      <div class="dialog-footer" slot="footer">
        <bq-button appearance="link">Button</bq-button>
        <bq-button variant="ghost">Button</bq-button>
        <bq-button variant="standard">Button</bq-button>
      </div>
    </bq-dialog>

    <script>
      const openDialogBtn = document.querySelector("bq-button");
      const dialogElem = document.querySelector("bq-dialog");

      openDialogBtn.addEventListener("bqClick", () => {
        dialogElem.open = true;
      });
    </script>
    ```

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

    export function NoBackdropDialog() {
      const dialogRef = useRef(null);

      return (
        <>
          <BqButton onBqClick={() => dialogRef.current?.show()}>Open dialog</BqButton>

          <BqDialog ref={dialogRef} disableBackdrop>
            <h5 slot="title">
              <BqIcon name="info" size="30" color="text--accent" role="img" title="Info" />
              Title
            </h5>

            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

            <div className="dialog-footer" slot="footer">
              <BqButton appearance="link">Button</BqButton>
              <BqButton variant="ghost">Button</BqButton>
              <BqButton variant="standard">Button</BqButton>
            </div>
          </BqDialog>
        </>
      );
    }
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqButton, BqDialog, BqIcon],
      template: `
        <bq-button (bqClick)="dialog.show()">Open dialog</bq-button>

        <bq-dialog #dialog disable-backdrop>
          <h5 slot="title">
            <bq-icon name="info" size="30" color="text--accent" role="img" title="Info"></bq-icon>
            Title
          </h5>

          <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

          <div class="dialog-footer" slot="footer">
            <bq-button appearance="link">Button</bq-button>
            <bq-button variant="ghost">Button</bq-button>
            <bq-button variant="standard">Button</bq-button>
          </div>
        </bq-dialog>
      `,
    })
    export class AppComponent {}
    ```

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

    const dialogRef = ref(null);
    </script>

    <template>
      <BqButton @bqClick="dialogRef?.show()">Open dialog</BqButton>

      <BqDialog ref="dialogRef" disableBackdrop>
        <h5 slot="title">
          <BqIcon name="info" size="30" color="text--accent" role="img" title="Info" />
          Title
        </h5>

        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

        <div class="dialog-footer" slot="footer">
          <BqButton appearance="link">Button</BqButton>
          <BqButton variant="ghost">Button</BqButton>
          <BqButton variant="standard">Button</BqButton>
        </div>
      </BqDialog>
    </template>
    ```
  </CodeGroup>
</CodeLivePreview>

### Confirm dialog

Use this variant to confirm irreversible actions with clear messaging and focused choices.

<CodeLivePreview
  mode="shadow"
  code={`
<style>
h5 {
  display: flex;
  font-weight: 700;
  align-items: center;
  gap: var(--bq-spacing-s);
}

.dialog-caption {
  color: var(--bq-text--secondary);
  font-size: var(--bq-font-size--s);
}

.dialog-footer {
  display: flex;
  gap: var(--bq-spacing-xs);
}
</style>

<bq-button variant="ghost">Deactivate account</bq-button>

<bq-dialog
disable-close-click-outside
disable-close-esc-keydown
hide-close-button
>
<h5 class="bold flex items-center gap-s" slot="title">
  <bq-icon name="info" size="30" color="icon--danger" role="img" title="Danger"></bq-icon>
  Deactivate account
</h5>

<p>Are you sure you want to deactivate your account? All of your data will be permanently removed.</p>
<span class="dialog-caption">This action cannot be undone</span>

<div class="dialog-footer" slot="footer">
  <bq-button appearance="secondary">Cancel</bq-button>
  <bq-button variant="danger">Yes, deactivate</bq-button>
</div>
</bq-dialog>

<script>
(() => {
  const dialog = previewRoot.querySelector('bq-dialog');
  const openButton = previewRoot.querySelector('bq-button[variant="ghost"]');
  const cancelButton = previewRoot.querySelector('bq-button[appearance="secondary"]');
  const confirmButton = previewRoot.querySelector('bq-button[variant="danger"]');
  if (!dialog || !openButton || !cancelButton || !confirmButton) return;

  const getNativeDialog = () => dialog.shadowRoot?.querySelector('dialog');
  const openPreviewDialog = () => {
    const nativeDialog = getNativeDialog();
    if (!nativeDialog?.showModal || nativeDialog.open) return;

    dialog.classList.add('bq-dialog--open');
    dialog.open = true;
    nativeDialog.classList.remove('hidden');
    nativeDialog.showModal();
  };
  const closePreviewDialog = () => {
    const nativeDialog = getNativeDialog();
    if (!nativeDialog?.open) return;

    nativeDialog.close();
    dialog.open = false;
    dialog.classList.remove('bq-dialog--open');
  };

  openButton.addEventListener('bqClick', openPreviewDialog);
  cancelButton.addEventListener('bqClick', closePreviewDialog);
  confirmButton.addEventListener('bqClick', closePreviewDialog);
})();
</script>
`}
>
  <CodeGroup>
    ```html HTML icon="html5" expandable theme={"theme":{"light":"one-light","dark":"night-owl"}}
    <bq-button variant="ghost">Deactivate account</bq-button>

    <bq-dialog
      disable-close-esc-keydown
      disable-close-click-outside
      hide-close-button
    >
      <h5 slot="title">
        <bq-icon name="info" size="30" color="icon--danger" role="img" title="Danger"></bq-icon>
        Deactivate account
      </h5>

      <p>Are you sure you want to deactivate your account? All of your data will be permanently removed.</p>
      <span class="dialog-caption">This action cannot be undone</span>

      <div class="dialog-footer" slot="footer">
        <bq-button appearance="secondary">Cancel</bq-button>
        <bq-button variant="danger">Yes, deactivate</bq-button>
      </div>
    </bq-dialog>

    <script>
      const deactivateBtn = document.querySelector('bq-button[variant="ghost"]');
      const cancelBtn = document.querySelector('bq-button[appearance="secondary"]');
      const confirmBtn = document.querySelector('bq-button[variant="danger"]');
      const dialogElem = document.querySelector("bq-dialog");

      deactivateBtn.addEventListener("bqClick", () => {
        dialogElem.open = true;
      });

      cancelBtn.addEventListener("bqClick", () => {
        dialogElem.open = false;
      });

      confirmBtn.addEventListener("bqClick", () => {
        dialogElem.open = false;
      });
    </script>
    ```

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

    export function ConfirmDialog() {
      const dialogRef = useRef(null);

      return (
        <>
          <BqButton variant="ghost" onBqClick={() => dialogRef.current?.show()}>
            Deactivate account
          </BqButton>

          <BqDialog
            ref={dialogRef}
            disableCloseClickOutside
            disableCloseEscKeydown
            hideCloseButton
          >
            <h5 slot="title">
              <BqIcon name="info" size="30" color="icon--danger" role="img" title="Danger" />
              Deactivate account
            </h5>

            <p>Are you sure you want to deactivate your account? All of your data will be permanently removed.</p>
            <span className="dialog-caption">This action cannot be undone</span>

            <div className="dialog-footer" slot="footer">
              <BqButton appearance="secondary" onBqClick={() => dialogRef.current?.cancel()}>
                Cancel
              </BqButton>
              <BqButton variant="danger" onBqClick={() => dialogRef.current?.hide()}>
                Yes, deactivate
              </BqButton>
            </div>
          </BqDialog>
        </>
      );
    }
    ```

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

    @Component({
      selector: "app-root",
      standalone: true,
      imports: [BqButton, BqDialog, BqIcon],
      template: `
        <bq-button variant="ghost" (bqClick)="dialog.show()">Deactivate account</bq-button>

        <bq-dialog
          #dialog
          disable-close-click-outside
          disable-close-esc-keydown
          hide-close-button
        >
          <h5 slot="title">
            <bq-icon name="info" size="30" color="icon--danger" role="img" title="Danger"></bq-icon>
            Deactivate account
          </h5>

          <p>Are you sure you want to deactivate your account? All of your data will be permanently removed.</p>
          <span class="dialog-caption">This action cannot be undone</span>

          <div class="dialog-footer" slot="footer">
            <bq-button appearance="secondary" (bqClick)="dialog.cancel()">Cancel</bq-button>
            <bq-button variant="danger" (bqClick)="dialog.hide()">Yes, deactivate</bq-button>
          </div>
        </bq-dialog>
      `,
    })
    export class AppComponent {}
    ```

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

    const dialogRef = ref(null);
    </script>

    <template>
      <BqButton variant="ghost" @bqClick="dialogRef?.show()">Deactivate account</BqButton>

      <BqDialog
        ref="dialogRef"
        disableCloseClickOutside
        disableCloseEscKeydown
        hideCloseButton
      >
        <h5 slot="title">
          <BqIcon name="info" size="30" color="icon--danger" role="img" title="Danger" />
          Deactivate account
        </h5>

        <p>Are you sure you want to deactivate your account? All of your data will be permanently removed.</p>
        <span class="dialog-caption">This action cannot be undone</span>

        <div class="dialog-footer" slot="footer">
          <BqButton appearance="secondary" @bqClick="dialogRef?.cancel()">Cancel</BqButton>
          <BqButton variant="danger" @bqClick="dialogRef?.hide()">Yes, deactivate</BqButton>
        </div>
      </BqDialog>
    </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>

    Make the title and primary action work together so the outcome of the dialog is unmistakable.
  </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>

    Do not use vague titles or button labels that force people to infer the meaning of the decision.
  </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 concise content and keep the structure easy to scan with a clear title, short body copy, and focused actions.
  </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>

    Do not duplicate actions in the footer or offer too many equally weighted choices.
  </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>

    Match the dialog size to the amount of content so the layout feels intentional and easy to scan.
  </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>

    Do not force long forms, dense tables, or multi-step workflows into a dialog that needs more room than the pattern is meant to provide.
  </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>

    Keep a reliable dismissal path available, especially in confirmation flows where people may need to back out safely.
  </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>

    Do not disable the close button, backdrop dismissal, and <kbd>Esc</kbd> handling together unless the action carries real risk and the remaining actions are explicit.
  </Card>
</CardGroup>

## Accessibility

* **Built-in dialog semantics** — the component applies `aria-labelledby="bq-dialog--title"` and `aria-modal="true"` to the native `<dialog>` element, so assistive technology can identify it as a modal surface.
* **Built-in close control labeling** — when the default close button is shown, it includes an accessible `label="Close"` and a decorative close icon marked with `aria-hidden="true"`.
* **Built-in focus management** — the native `<dialog>` element automatically traps keyboard focus within the dialog while it is open and restores it to the previously focused element when the dialog closes.
* **Provide a meaningful title** — the content you place in the `title` slot becomes the dialog's accessible label, so it should clearly describe the decision, task, or message.
* **Include an explicit dismissal path** — if you hide the close button or disable outside dismissal, provide a clear cancel or close action in the footer.
* **Preserve keyboard expectations** — keep <kbd>Esc</kbd> enabled for dismissible dialogs unless there is a strong product reason to require an explicit choice.
* **Use precise action labels** — button text should describe the result of the action, especially in confirmations and destructive flows.
* **Use `disable-backdrop` carefully** — removing the backdrop changes the modal emphasis, so make sure the surrounding page does not compete visually with the dialog content.

## API reference

### Properties

| Property                   | Attribute                     | Description                                                                | Type                                                     | Default      |
| -------------------------- | ----------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------- | ------------ |
| `border`                   | `border`                      | Border radius of the dialog component                                      | `"none" \| "xs2" \| "xs" \| "s" \| "m" \| "l" \| "full"` | `"m"`        |
| `disableBackdrop`          | `disable-backdrop`            | If `true`, the backdrop overlay won't be shown when the dialog opens       | `boolean`                                                | `false`      |
| `disableCloseClickOutside` | `disable-close-click-outside` | If `true`, the dialog will not close when clicking on the backdrop overlay | `boolean`                                                | `false`      |
| `disableCloseEscKeydown`   | `disable-close-esc-keydown`   | If `true`, the dialog will not close when the `Esc` key is pressed         | `boolean`                                                | `false`      |
| `footerAppearance`         | `footer-appearance`           | The appearance of the footer                                               | `"standard" \| "highlight"`                              | `"standard"` |
| `hideCloseButton`          | `hide-close-button`           | If `true`, hides the close button                                          | `boolean`                                                | `false`      |
| `open`                     | `open`                        | If `true`, the dialog is shown as open                                     | `boolean`                                                | `false`      |
| `size`                     | `size`                        | The size of the dialog                                                     | `"small" \| "medium" \| "large"`                         | `"medium"`   |

### Events

| Event          | Description                                    | Type                |
| -------------- | ---------------------------------------------- | ------------------- |
| `bqAfterClose` | Fired after the dialog finishes closing        | `CustomEvent<void>` |
| `bqAfterOpen`  | Fired after the dialog finishes opening        | `CustomEvent<void>` |
| `bqCancel`     | Fired when the dialog is canceled or dismissed | `CustomEvent<void>` |
| `bqClose`      | Fired when the dialog is about to close        | `CustomEvent<void>` |
| `bqOpen`       | Fired when the dialog is about to open         | `CustomEvent<void>` |

### Methods

| Method     | Description                     | Returns         |
| ---------- | ------------------------------- | --------------- |
| `cancel()` | Dismisses or cancels the dialog | `Promise<void>` |
| `hide()`   | Closes the dialog               | `Promise<void>` |
| `show()`   | Opens the dialog                | `Promise<void>` |

### Slots

| Slot           | Description                               |
| -------------- | ----------------------------------------- |
| `title`        | The title content of the dialog           |
| *(default)*    | The body content of the dialog            |
| `footer`       | The footer content of the dialog          |
| `button-close` | Replaces the default close button content |

### Shadow parts

| Part           | Description                                                |
| -------------- | ---------------------------------------------------------- |
| `body`         | The `<main>` section that holds the dialog body content    |
| `button-close` | The button that closes the dialog on click                 |
| `content`      | The container that holds the dialog title and body content |
| `dialog`       | The native `<dialog>` wrapper inside the shadow DOM        |
| `footer`       | The footer that holds action content                       |
| `header`       | The header that holds the title and close button           |
| `title`        | The element that wraps the title slot                      |

### CSS custom properties

<Expandable title="CSS variables" defaultOpen={false}>
  | Variable                           | Description                          | Default                         |
  | ---------------------------------- | ------------------------------------ | ------------------------------- |
  | `--bq-dialog--background`          | Dialog background color              | `var(--bq-ui--primary)`         |
  | `--bq-dialog--background-backdrop` | Dialog backdrop background color     | `var(--bq-background--overlay)` |
  | `--bq-dialog--text-color`          | Dialog text color                    | `var(--bq-text--primary)`       |
  | `--bq-dialog--box-shadow`          | Dialog box shadow                    | `var(--bq-box-shadow--l)`       |
  | `--bq-dialog--border-color`        | Dialog border color                  | `transparent`                   |
  | `--bq-dialog--border-style`        | Dialog border style                  | `none`                          |
  | `--bq-dialog--border-width`        | Dialog border width                  | `unset`                         |
  | `--bq-dialog--border-radius`       | Dialog border radius                 | `var(--bq-radius--m)`           |
  | `--bq-dialog--padding`             | Dialog padding                       | `var(--bq-spacing-l)`           |
  | `--bq-dialog--content-footer-gap`  | Gap between the content and footer   | `var(--bq-spacing-l)`           |
  | `--bq-dialog--title-body-gap`      | Gap between the title and body       | `var(--bq-spacing-s)`           |
  | `--bq-dialog--width-small`         | Small dialog width                   | `320px`                         |
  | `--bq-dialog--width-medium`        | Medium dialog width                  | `480px`                         |
  | `--bq-dialog--width-large`         | Large dialog width                   | `640px`                         |
  | `--bq-dialog-z-index`              | Z-index used when the dialog is open | `10`                            |
</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-dialog--default">
    Explore dialog examples and states in Storybook
  </Card>

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