Overlay

A responsive overlay component that adapts between modal, popover, and drawer based on screen size.

<Dialog>
  <Button>Open overlay</Button>
  <Overlay>
    <DialogContent>some content</DialogContent>
  </Overlay>
</Dialog>

Installation

pnpm dlx shadcn@latest add @dotui/overlay

Usage

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

import { Button } from "@/components/ui/button";
import { Dialog, DialogContent } from "@/components/ui/dialog";
import { Overlay } from "@/components/ui/overlay";
<Dialog>
  <Button>Open Overlay</Button>
  <Overlay type="modal" mobileType="drawer">
    <DialogContent>Overlay content</DialogContent>
  </Overlay>
</Dialog>

Playground

Use the controls below to experiment with different overlay props and see the live preview and code update.

type
mobileType

API Reference

Missing description.

PropType
Type
Type | null
Omit<PopoverProps, "children" | CommonProps>
Omit<ModalProps, "children" | CommonProps>
Omit<DrawerProps, "children" | CommonProps>
boolean
((element: Element) => boolean)
boolean

Last updated on 12/21/2025

dotUI

Bringing singularity to the web.

Built with passion by @mehdibha.