Components
Backdrop
Decorative dot pattern or image that fades in at the bottom of the viewport behind the page.
import { Backdrop, Shell } from "@openperf/deft";
<Shell.Root>
<Backdrop.Root />
<Shell.Main>{children}</Shell.Main>
</Shell.Root>;Placement
Render one Backdrop as the first child of Shell.Root in Shell or Standalone.Root in Standalone. Both isolate their stacking, so the backdrop paints over the background of the frame and under everything else in it.
| Property | Value |
|---|---|
| Position | Fixed to the bottom of the viewport, full width. |
| Height | 46vh, fading to transparent towards the top. |
| In Shell | From 900px up, starts at the right edge of the sidebar instead of the viewport's left. |
It is hidden from assistive technology and ignores the pointer, so never put content or controls in it. It is not the scrim behind an overlay: Dialog and Drawer draw their own.
Image
Pass image with the same picture in two formats to replace the dots; the browser picks one of them.
<Backdrop.Root image={{ avif: "/hills.avif", webp: "/hills.webp" }} />The image is anchored to the bottom, stretched to the full width and desaturated. Below 900px it covers the area instead.
Inside a box
To draw the backdrop inside a box rather than on the viewport, as the preview above does, make the box a positioned, isolated container and override the position through className:
<div className="relative isolate h-64">
<Backdrop.Root className="absolute h-full" />
</div>API
Prop
Type
The type of image is exported as BackdropImage.