Open In App

Primer CSS Pagination

Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture. It is highly reusable and flexible. It is created with GitHub’s design system.

Primer CSS Pagination is used to create the set of pages and we can jump to any page if we want. We can go to previous, next, and numbered pages.



Primer CSS Pagination Classes:

Syntax:



<nav class="paginate-container">
  <div class="pagination">
    <span class="previous_page" aria-disabled="true">
         ... 
    </span>
    <a href="#" aria-label="..."> ... </a>
    <a class="next_page" rel="next" href="#">
        ...
    </a>
  </div>
</nav>

Example 1: This example demonstrates the implementation of Primer CSS Pagination.




<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Pagination </title>
    <link rel="stylesheet" href=
"https://unpkg.com/@primer/css@^18.0.0/dist/primer.css" /> 
</head>
  
<body>
    <div class="text-center">
        <h1 class="color-fg-success"> GeeksforGeeks </h1>
        <h3> Primer CSS Pagination </h3> <br>
  
        <nav class="paginate-container">
            <div class="pagination">
                <span class="previous_page" href="#">
                    Previous
                </span>
                <a class="next_page" href="#" >
                    Next
                </a>
            </div>
        </nav>
    </div>
</body>
  
</html>

Output:

Primer CSS Pagination

Example 2: This example demonstrates the implementation of Primer CSS Pagination.




<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Pagination </title>
    <link rel="stylesheet" href=
"https://unpkg.com/@primer/css@^18.0.0/dist/primer.css" /> 
</head>
  
<body>
    <div class="text-center">
        <h1 class="color-fg-success"> GeeksforGeeks </h1>
        <h3> Primer CSS Pagination </h3> <br>
  
        <nav class="paginate-container">
            <div class="pagination">
                <span class="previous_page" href="#">
                    Previous
                </span>
                <em aria-current="Page1"> 1 </em>
                <a href="#" aria-label="2"> 2 </a>
                <a href="#" aria-label="3"> 3 </a>
                <span class="gap">…</span>
                <a href="#" aria-label="11"> 11 </a>
                <a href="#" aria-label="12"> 12 </a>
                <a class="next_page" href="#" >
                    Next
                </a>
            </div>
        </nav>
    </div>
</body>
  
</html>

Output:

Primer CSS Pagination.

Reference: https://primer.style/css/components/pagination


Article Tags :