Skip to content

DeferredContent ​

Render when scrolled into view

Content rendered only when it scrolls near the viewport — a heavy chart, an embed, comments at the end of a long page. Don't defer what people search the page for: until it renders, find-in-page and screen readers can't see it.

Basic
image below mounts only when within 200px of the viewport
  • rootMargin starts it before it's visible (200px ahead by default); minHeight holds space so the page doesn't jump.
  • #placeholder shows until then; @load fires once, including where IntersectionObserver is missing and it renders at once.

Usage ​

ts
import { BlessDeferredContent } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
rootMarginstring"200px"
minHeightstring"1px"

Events

NamePayloadDescription
load[]

Slots

NameScopeDescription
default—
placeholder—

Released under the MIT License. Character names and artwork belong to their owners.