npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vonage/vwc-pagination

v2.46.0

Published

Pagination component

Downloads

810

Readme

vwc-pagination

vwc-pagination component dedicated to provide paged view state representation and management.

This component would be used with another, relevant, layouts, like vwc-data-grid, while both components would establish interoperability based on the APIs described here.

Structure

vwc-pagination is an inline block component.

vwc-pagination component is featured with navigational controls (move to previous page, move to next page) and a listed, ellipsed representation of pages (numeric, 1-based).

API

vwc-pagination is rolling around the total number of pages and the currently selected page.

Attributes / Properties

| Property | Attribute | Type | Default | Description | |-----------------|------------------|----------|---------|-------------| | total | total | number | 0 | total number of pages, as provided by the consuming application | selectedIndex | selected-index | number | -1 | currently selected page; always has some numeric value except when the total is 0; number reflects a 0-based index (when the first page selected, selected equals to 0) | | | prev-disabled | presence | managed | an auto managed attribute for a custom styling/logic; will be placed when 'go to previous page' control should be disabled, otherwise removed | | | next-disabled | presence | managed | an auto managed attribute for a custom styling/logic; will be placed when 'go to next page' control should be disabled, otherwise removed |

Note: if the total is adjusted to smaller number and selected appears to be out of range, the selected is set to the closest new available page (change event is fired as appropriate)

Events

| Event | Description | |----------|-------------| | change | fired each time selected page changed (also when the initial selection happens, or when total is changed and as an outcome the selected page changed; event.detail: { selectedIndex: number; total: number }) |

Customization

vwc-pagination component allows customly slotted prev/next controls (see slots description below). In order to allow custom styling/behaviour of those parts, there are 2 managed component level attributes: prev-disabled / next-disabled (see above).

Slots

vwc-pagination allows the customization via the slots.

| Slot name | Description | |----------------|-------------| | prev-control | allows to override the default layout of the 'go to previous page' control button | | next-control | allows to override the default layout of the 'go to next page' control button |