A lightweight, framework-agnostic paginator built as a native Web Component.
• Smooth pill-style animation between pages
• Fully encapsulated styles (Shadow DOM)
• Zero dependencies – works everywhere modern ES modules are supported
• Customisable via attributes & public API methods
• Emits page-changed
events so your app can react to user navigation
npm install animated-paginator-web-component
# or
yarn add animated-paginator-web-component
Simply import the package once (ES module) and drop the element into your HTML. No framework required:
<!-- main.js -->
import 'animated-paginator-web-component';
<!-- index.html -->
<animated-paginator
pages="5"
initial-page="0"
page-colors="#4285F4,#FDBB2D,#9A40D3,#34A853,#EA4335">
</animated-paginator>
const paginator = document.querySelector('animated-paginator');
paginator.addEventListener('page-changed', ({ detail }) => {
console.log(`Moved from ${detail.oldPage} → ${detail.newPage}`);
});
paginator.next(); // advance one page
paginator.previous(); // go back one
console.log(paginator.getCurrentPage());
-
Clone & install:
git clone https://github.com/yourgithub/animated-paginator-web-component && cd animated-paginator-web-component && npm i
-
Link the package (optional):
npm link
and in a demo projectnpm link animated-paginator-web-component
- Open
demo/index.html
in your browser to see it in action.
MIT © Elad Ben-Haim