Backdrop
A faint landscape or dot pattern fixed to the bottom of the page. Gives the page ground without competing with content.
import { Backdrop } from "@openperf/deft";
import { Preview } from "../../src/Preview";
export default function BackdropBasic() {
return (
<Preview block={true}>
<div className="relative isolate h-64">
<Backdrop.Root className="absolute h-full" />
</div>
</Preview>
);
}
- Use one behind application and standalone pages. It covers about the lower half of the viewport, fades in from the top and stays faint in both themes.
- It draws dots by default. Pass
imagewithavifandwebpsources to draw a landscape instead. Choosing the image, such as one per palette, is up to the app; pass per-image adjustments throughclassName. - It is fixed behind the content, so render it inside an element that creates a stacking context:
Shell.RootorStandalone.Root. InsideShell.Rootit starts after the sidebar frommdup. - It is decorative: hidden from assistive technology and ignores the pointer.
API
PropType
image?{ avif: string; webp: string }
Draws the image instead of the dot pattern.
Type
{ avif: string; webp: string }Parts: Root. Other props go to the native div.