Ludic Logo
Edit

Loaders

Loaders help load content asynchronously when the HTML page is rendered. The module currently contains only one loader requiring HTMX enabled.

Lazy Loader

#
from ludic.catalog.loaders import LazyLoader

LazyLoader(load_url="https://example.com/huge-image.png")

The default placeholder displayed before the content is loaded looks like this:

However, you can use your own placeholder:

from ludic.catalog.loaders import LazyLoader, Loading

LazyLoader(
    load_url="https://example.com/huge-image.png",
    placeholder=Loading(),  # replace with your own placeholder
)
Made with Ludic and HTMX and 🐍 • DiscordGitHub