
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
pagination-webcomponent
Advanced tools
A lightweight, reusable, framework-agnostic pagination component built using Web Components (Custom Elements + Shadow DOM). Easily integrates into any HTML/JS app with no external dependencies.
<pagination-component>
A lightweight, reusable, framework-independent pagination component built using Web Components (Custom Elements + Shadow DOM). Easily integrates into any HTML/JS app with no external dependencies.
<pagination-component>
is a lightweight, reusable Web Component that provides navigational pagination controls for paginated data views. It is framework-agnostic and can be used with any frontend stack including plain HTML/JS, React, Vue, Svelte, etc.
This component supports dynamic page ranges, ellipses for skipped blocks, and emits navigation events to allow integration with your data-fetching or UI update logic.
page-change
event with all pagination info🔗 CodePen: https://codepen.io/driftblaze/pen/gbaYvpG
npm i pagination-webcomponent
then import as
import ('pagination-webcomponent')
<script type="module" src="https://unpkg.com/pagination-webcomponent"></script>
import './PaginationComponent.js';
<script type="module" src="/path/to/PaginationComponent.js"></script>
<pagination-component
offset="0"
per-page="10"
total="100"
></pagination-component>
<script>
const pagination = document.querySelector('pagination-component');
pagination.addEventListener('page-change', (e) => {
console.log('New offset:', e.detail.offset);
// Fetch data using e.detail.offset and e.detail.limit
});
</script>
Attribute | Type | Required | Description |
---|---|---|---|
offset | Number | ✅ | The current item offset (e.g., 0, 10, 20, ...). Clamped to valid bounds. |
per-page | Number | ✅ | Number of items per page |
total | Number | ✅ | Total number of items |
All attributes are reflected and can be dynamically updated.
page-change
Dispatched whenever the user changes the page.
{
"offset": Number, // New offset (e.g., 30)
"limit": Number, // Items per page (e.g., 10)
"total": Number, // Total items (e.g., 100)
"totalPages": Number // Derived total pages (e.g., 10)
}
The component is styled via Shadow DOM and accepts the following CSS custom properties:
CSS Variable | Description |
---|---|
--pagination-background | Button background |
--pagination-text | Button text color |
--pagination-border | Button border color |
--pagination-hover | Button hover and active background |
--pagination-active-border | Active page border highlight |
--pagination-active-color | Active button text color |
To override them:
pagination-component {
--pagination-background: #181118;
--pagination-text: #ecdfe8;
--pagination-border: #9c8c9a;
--pagination-hover: #91379f;
--pagination-active-border: #ffcaff;
--pagination-active-color: #ecdfe8;
}
<button>
elementsdisabled
statesThis component is maintained by Yash Raj Bharti.
FAQs
A lightweight, reusable, framework-agnostic pagination component built using Web Components (Custom Elements + Shadow DOM). Easily integrates into any HTML/JS app with no external dependencies.
The npm package pagination-webcomponent receives a total of 0 weekly downloads. As such, pagination-webcomponent popularity was classified as not popular.
We found that pagination-webcomponent demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.