Load More Button Template

Allow users to progressively load more content with this intuitive and versatile button.

This is a fundamental component for any content-heavy page, such as a blog archive, product grid, or user feed, improving performance by loading items on demand.

Screenshot of a 'Load More' button for appending content to a list.

Get Source Code Preview

About the Load More Button

Instead of overwhelming users with a huge list of items or forcing them to navigate through numbered pages, a "Load More" button provides a friendly way to reveal more content. It signals that there is more to see, giving the user control over when they see it. This pattern can improve initial page load times and create a smoother browsing experience.

Features

Code Breakdown

The component includes the button itself and some sample list items to demonstrate its use. The button contains a text span and a CSS-only spinner element.

JavaScript controls the button's behavior. On click, it adds an is-loading class to the button. This class uses CSS to hide the text and show the spinner. The script simulates an API call with setTimeout. After loading, it adds new items to the list and resets the button. A counter tracks the clicks, and once a limit is reached, the button becomes disabled to show there's nothing left to load.

Code

Here is the complete HTML, CSS, and JavaScript for the "Load More" button demonstration.

View Output