I was working on a client's project and they wanted paginations all over the project, since the volume of data that we were working with was huge.

So I thought of creating Pagination in LWC and reuse it.

It turned out to be a great life saver, also the rendering of data was super fast!

Please check the code here!

Am starting off with the template file.

Then comes the JS file where we have all the logic in place.

And here is the CSS file. Used it to add little bit of custom styling.

And finally the apex class.

That is it all!

In case you implemented using some other logic, feel free to comment. Would love to check it out.

Liked the post? Let me know what you think of it.

Interested in learning LWC Development with me? Subscribe to my course (use this if you are out of India).

Also check