

<InteractiveDemo
  name="overlay"
  controls="[
  {
    type: 'enum',
    name: 'type',
    options: ['modal', 'popover', 'drawer'],
    defaultValue: 'modal',
  },
  {
    type: 'enum',
    name: 'mobileType',
    options: ['modal', 'drawer'],
    defaultValue: 'drawer',
  },
]"
/>

## Installation [#installation]

<CodeBlockTabs defaultValue="npm">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="npm">
      npm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="pnpm">
      pnpm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="yarn">
      yarn
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="bun">
      bun
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="npm">
    ```bash
    npx shadcn@latest add @dotui/overlay
    ```
  </CodeBlockTab>

  <CodeBlockTab value="pnpm">
    ```bash
    pnpm dlx shadcn@latest add @dotui/overlay
    ```
  </CodeBlockTab>

  <CodeBlockTab value="yarn">
    ```bash
    yarn dlx shadcn@latest add @dotui/overlay
    ```
  </CodeBlockTab>

  <CodeBlockTab value="bun">
    ```bash
    bun x shadcn@latest add @dotui/overlay
    ```
  </CodeBlockTab>
</CodeBlockTabs>

## Usage [#usage]

Use Overlay as a responsive wrapper that automatically switches between Modal, Popover, and Drawer based on screen size and configuration.

```tsx
import { Button } from '@/components/ui/button'
import { Dialog, DialogContent } from '@/components/ui/dialog'
import { Overlay } from '@/components/ui/overlay'
```

```tsx
<Dialog>
  <Button>Open Overlay</Button>
  <Overlay type="modal" mobileType="drawer">
    <DialogContent>Overlay content</DialogContent>
  </Overlay>
</Dialog>
```

## Examples [#examples]

<Examples>
  <Example name="overlay/demos/basic" />

  <Example name="overlay/demos/type" />
</Examples>

## API Reference [#api-reference]

<Reference name="overlay" />
