Load More
Loads more entries on click.
Blitz
{{ sprig('_components/load-more') }}
{#--- _components/load-more.twig ---#}
{% set entries = craft.entries.offset(offset).limit(_limit).all() %}
{% for entry in entries %}
{{ entry.title }}
{% endfor %}
{% if entries %}
<button sprig
s-val:offset="{{ offset + _limit }}"
s-target="this"
s-swap="outerHTML"
>
Load more
</button>
{% endif %}