How to limit load more button to display only 40 items of repeater on a one page

I want to display maximum 40 item on a single page. I have more that 200 item and when I click on load more button it loads 5 items at a time till the collection end. And after loading more that 50 item on a single page the page respond slowly and also it take so much time to load
So how can I limit dataset so that it only display 40 items and when I click next page it display next 40 item
I think we should use load more button and pagination bar at a single page but how do I limit load more button so it only display 40 item and then disappear.

Thank You!

If you are using Wix Stores then try using the dataset option of how many items to display, set that at 40 and see what you get in return.

If you are using a table to display your results, then you can simply set the rows per page number to 40 and have the pagination setup to go to the next page etc.

I am using repeater and I have set dataset to show 5 item but it is not working.
How to use pagination bar and load more button on the same page? and limit the load more button to display only 40 item per page

Click on the dataset itself and on the dataset settings there should be a option where you can put in the quantity of items that you want to display.

CMS (Formerly Content Manager): About Displaying Collection Content in a Repeater | Help Center | Wix.com (plus also scroll down to read ‘Navigating through a repeater’ as well.)

Have a view of this video about repeaters:

Also this was on another forum post:
Unless you are connecting a dataset you will need to do this in code using onClick events from a previous and next button.

The repeater displays whatever you give it in the data property. So you need to break your manually created data into “pages”. Then assign each “page” of data to the repeater’s data property.

When the relevant onClick event is handled you simply overwrite the data property with your next “page” (or previous) and use forEachItem() to render the data.

If you use a data collection connected to a dataset the. You can wire up the dataset API to do this or via the Wix Editor.

https://www.wix.com/code/reference/$w.Repeater.html