search⌘K

Overlay

Last Updated: September 2026

Overlays are a visual blocker that occludes content behind it in order to get the user to focus on whats above it.

Anatomy

link
Dotted grid scale: 8px
  1. 1Backdrop

Variants

link

Absolute

Default. Fills the nearest positioned ancestor.

With blur

blur softens content behind the dimmer.

Fixed

position="fixed" covers the viewport — usually mounted by the app shell.

Usage Guidelines

link

When to use

  • •As the dimmed backdrop behind custom dialogs or takeovers.
  • •When you need the same surface Modal uses, without the dialog chrome.
  • •To temporarily de-emphasize page content under floating UI.

When not to use

  • •When you need a full dialog — use Modal (it already includes Overlay).
  • •For anchored tips — use Popover or Tooltip.
  • •As a standalone page background treatment.
checkDo

Place absolute Overlay inside a positioned parent.

closeDon't

Don't use absolute Overlay without a positioned ancestor — it won't cover what you expect.

checkDo

Prefer Modal/Drawer when you need dialog behavior — they own the backdrop.

closeDon't

Don't stack a manual Overlay on top of Modal's own backdrop.

Behaviors

link

Presentational only

  • •Overlay does not manage open state — parents mount/unmount or toggle it.
  • •It does not trap focus or provide dialog semantics.

Positioning

  • •absolute (default) fills a relative/absolute/fixed parent.
  • •fixed covers the viewport and uses the modal z-index token.

Content Guidelines

link

Usage

  • •Keep Overlay free of text — content belongs in the dialog above it.
  • •Use blur sparingly when readability behind the dimmer matters less.

Accessibility

link

Text & Labels

  • •Overlay is decorative; the dialog above it must provide the accessible name.

ARIA attributes

  • •Prefer Modal/Drawer for accessible modal behavior rather than Overlay alone.

Keyboard Support

  • •Overlay itself is not focusable — keyboard handling belongs on the dialog layer.

WCAG Compliance Standards

FAQs

link

Does Overlay open and close itself?

No. It is presentational. Mount it when you need a backdrop, or use Modal/Drawer which include one.

When do I use blur?

When you want to further de-emphasize content behind the dimmer. Default is a flat scrim without blur.

Why isn't my absolute Overlay covering the card?

The parent needs position: relative (or absolute/fixed) and usually overflow handling.

link