@cdransf/select-pagination

1.1.0 • Public • Published

select-pagination

A Web Component for selecting the desired page from a paginated list.

Features

This Web Component allows you to progressively enhance a page count for a paginated view into a select element that allows for more convenient page navigation.

Installation

Install via npm: npm install @cdransf/select-pagination

The component assumes your pagination starts at index 0, but you may override this using the baseIndex attribute.

Example usage

Add the select-pagination.js to your markup and define the necessary component markup:

<select-pagination>
  <select>
    <!-- populate your option tags iteratively -->
    <option value="0">1 of 36</option>
    <option value="1">2 of 36</option>
  </select>
  <!-- add noscript display -->
  <noscript><div class="text--centered"><span aria-current="page">1</span> of 36</div></noscript>
</select-pagination>

Package Sidebar

Install

npm i @cdransf/select-pagination

Weekly Downloads

42

Version

1.1.0

License

MIT

Unpacked Size

7.29 kB

Total Files

8

Last publish

Collaborators

  • cdransf