list.js
list.js copied to clipboard
Custom page classes for pagination
Love 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.
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?
Having the same issue here. Does anyone start working on that? I can help!
Hey @fccoelho7!
I made a fork that allow me to use Bootstrap styling. It's not perfect because you cannot customize the styling, but it's working for my use-case.
Hey, is there any update to this issue? I need also to add custom classes to <li>.
Which file should I edit in order to add it manually?
Update?
update ?
https://github.com/javve/list.js/issues/744#issuecomment-1086039470 I hopes it can help :)