SSP - Single Standard for Pagination

SSP - Single Standard for Pagination

54

1 min.

Definitions

The SSP standard defines requirements for the semantics, accessibility, and logic of pagination.

Structure and Semantics

The entire pagination block is wrapped in a <nav> tag to indicate the navigation area, page numbers should be implemented as an ordered list <ol>, the back and forward buttons are placed inside the <nav> tag, before and after the list, respectively.

Accessibility

The active page is always marked with the aria-current="page" attribute to ensure screen readers function correctly, and inactive buttons must have aria-disabled and tabindex="-1".

Interactivity and Visual Feedback

Back and forward links must be blocked and become inactive when the first and last pages are reached, the current page must be highlighted with a visually contrasting style. If there are a large number of pages, ellipses are used to separate the first, last, and central groups of links.

Final example

<nav class="pagination">
  <a href="#" class="pagination__previous disabled" aria-disabled="true" tabindex="-1">Previous</a>
  <ol class="pagination__list">
    <li class="pagination__item">
      <a href="?page=1" class="pagination__link">1</a>
    </li>
    <li class="pagination__item">
      <span class="pagination__ellipsis">...</span>
    </li>
    <li class="pagination__item">
      <a href="?page=4" class="pagination__link">4</a>
    </li>
    <li class="pagination__item">
      <a href="?page=5" class="pagination__link active" aria-current="page">5</a>
    </li>
    <li class="pagination__item">
      <a href="?page=6" class="pagination__link">6</a>
    </li>
    <li class="pagination__item">
      <span class="pagination__ellipsis">...</span>
    </li>
    <li class="pagination__item">
      <a href="?page=20" class="pagination__link">20</a>
    </li>
  </ol>
  <a href="?page=6" class="pagination__next">Next</a>
</nav>

Similar categories:

Similar articles

  • Anatomy of a React component

    My vision for how every React component should look

    99

    8 min.

  • SSF-U - Single Standard for Fullscreen

    The SSF-U standard defines requirements for the semantics, accessibility, and logic of fullscreen

    33

    2 min.

  • SSA - Single Standard for Accordion

    The SSA standard defines requirements for the semantics, accessibility, and logic of accordion

    47

    2 min.

  • Bad Practices for Websites

    An Analysis of Critical Web Design Mistakes. Why Sliders, Autoplay, and Slow-Loading Pages Reduce Conversion Rates and Rankings on Google and Yandex

    45

    2 min.

  • SSPS - Single Standard for Project Structure

    The SSPS standard defines requirements for the structure and naming of files and folders in a project

    165

    2 min.

  • SSG - Single Standard for Git

    The SSG standard defines requirements for the semantics, accessibility, and logic of Git

    48

    3 min.

  • All articles

Contact me