lace:lazy
Defer a component until it scrolls into view, showing a placeholder until then. For the full guide with live demos, see Lazy Loading.
Syntax
{% interlace "HeavyComponent" lazy=True %}
The component isn't rendered on initial page load; it renders when it enters the viewport.
Define inline_placeholder() on the component to control what shows in the meantime.
Example
<!-- above the fold -->
<div>Main content...</div>
<!-- rendered when scrolled into view -->
{% interlace "CommentSection" lazy=True %}
{% interlace "RelatedProducts" lazy=True %}
Best for below-the-fold content with expensive queries - comment threads, related products, analytics widgets.