Server Component · 0 KB client JS

Backdrop

The scrim Modal and Drawer paint behind their panels, exposed as a standalone primitive, for blocking "please wait" states, image viewers and custom overlays. It is purely presentational and ships zero client JavaScript: render it to show it; mounting, transitions and dismissal belong to the caller.

Content that is busy loading sits behind the scrim.

Loading…

Import#

import { Backdrop } from "astralis-ui";

Scoping the scrim#

The scrim is position: fixed (full screen) by design. To scope it to a frame, as the demo above does, put it in a position: relative container and pass style={{ position: "absolute" }}. Going the other way, a full-screen scrim rendered deep inside a clipped or transformed container belongs in a Portal, so no ancestor can clip it.

Props#

Extends div props:

PropTypeDefaultDescription
blurbooleantrueFrosts the content behind the scrim.
childrenReactNodeNoneCentered on the scrim, such as a Loader or a message.
styleCSSPropertiesNonebackgroundColor replaces the scrim color; position scopes it to a frame.

Backdrop has no keyboard behavior of its own: it doesn't trap focus or close on Escape. If it blocks the page, move focus to what it's waiting on, or use Modal, which handles both.