Skip to content

Overlay

Get Ritla UI

A layer that dims and blurs the page behind a modal, a sheet or a busy state.

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add overlay

    Also works with shadcn: npx shadcn@latest add @ritla/overlay

  2. Or copy by hand

    Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.

Usage

overlay.tsx
import { Overlay } from "@/components/ui/overlay";<div className="relative">  …  <Overlay type="gradient" /></div>

API reference

Overlay

PropTypeDefaultDescription
type"solid" | "gradient" | "transparent""solid"Figma's Type: a solid dim, a dim that deepens towards the bottom, or none (blur only).
blurbooleantrueFigma's Background blur: blurs what is behind at backdrop-blur-elevation-md.
fixedbooleanfalseCovers the whole screen at z-overlay instead of the nearest positioned parent.

Accessibility

ARIA

  • The layer is decorative: aria-hidden, and it takes no focus.
  • Dialog and Drawer draw their own and trap focus; if you build a custom layer, trap focus and close it with Esc.

Arabic and RTL notes

Does not mirror

  • The gradient runs top to bottom, so it doesn't mirror.
Numerals
It holds no numbers.
Arabic typography
It holds no text.