Skip to content
Calm motion: animations on this site only fade, with no movement

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. Do not defer what people search the page for: until it renders, find-in-page and screen readers cannot see it.

Basic
image below mounts only when within 200px of the viewport
  • rootMargin starts it before it is visible (200px ahead by default). minHeight holds space so the page does not 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.