Custom page classes for pagination
See original GitHub issueLove the library! However, I was surprised to find no option for easily adding custom class attributes to a pagination item for styling purposes, e.g. instead of using only the default classes:
<ul class="pagination">
<li class="active">
<a class="page" href="...">1</a>
</li>
...
</ul>
I wanted to add some Bootstrap class names:
<ul class="pagination">
<li class="page-item active">
<a class="page-link page" href="...">1</a>
</li>
...
</ul>
This could be achieved by allowing tweaks to the following line in pagination.js:
https://github.com/javve/list.js/blob/52afe2db0d018df3009acf49b6cbb56943b28024/src/pagination.js#L85
This could, for example, be achieved by adding two new options during list initialization, similar to the paginationClass
option.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:7
Top Results From Across the Web
Pagination - Bootstrap
Pagination links are customizable for different circumstances. Use .disabled for links that appear un-clickable and .active to indicate the current page. While ...
Read more >Pagination - Django REST framework
REST framework includes support for customizable pagination styles. This allows you to modify how large result sets are split into individual pages of...
Read more >How to Build a Custom Pagination Component in React
In this post, we will focus on pagination and we'll build a custom controlled component that handles page buttons based on the current...
Read more >How to create a custom Pagination Class with page numbers?
I'm trying to create a custom pagination class. Here is my try: class CustomPagination(PageNumberPagination): page_item_count = 10 page = 1 ...
Read more >How To Build Custom Pagination with React | DigitalOcean
Next, you defined the fetchPageNumbers() method in the Pagination class. This method handles the core logic for generating the page numbers to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @javve! 👋
I found myself in the same situation as @cdekkers. I want to change the styling of the pagination and I’m not able to do so with the current version.
I saw that there’s multiple PR that should solve this issue. May I help somewhere to get this feature in your library?
https://github.com/javve/list.js/issues/744#issuecomment-1086039470 I hopes it can help 😃