Skip to content
Related Articles

Related Articles

Improve Article

Bulma | Pagination

  • Last Updated : 29 Jun, 2020

Bulma is a FLexbox based open-source CSS framework and its completely free. It is component rich, compatible, and well documented. It is highly responsive in nature. It uses classes to implement its design.
The ‘pagination’ is a component used to indicate the existence of a series of related content across multiple pages. Pagination is used to enable navigation between pages on a website. The pagination component includes several other components that we have to add exclusively to design our content well. These components are listed below.

  • pagination-previous: It is used to navigate to the previous page.
  • pagination-next: It is used to navigate to the next page.
  • pagination-list: It is used to display different pages of the website.
    • pagination-link: It is to indicate the page number in the anchor tag.
    • pagination-ellipsis: It creates the range separators between the page numbers.

Example 1: This example shows simple Bulma pagination component.




<!DOCTYPE html>
<html>
  
<head>
  <title>Bulma Pagination</title>
  <link rel='stylesheet' href=
  
  <!-- custom css -->
  <style>
    div.columns {
      margin-top: 80px;
    }
  </style>
</head>
  
<body>
  <div class='container'>
    <div class='columns is-mobile is-centered'>
      <div class='column is-10'>
        <nav class="pagination" role="navigation" 
            aria-label="pagination">
          <a class="pagination-previous">Previous</a>
          <a class="pagination-next">Next page</a>
          <ul class="pagination-list">
            <li>
              <a href="#" class="pagination-link" 
                aria-label="Page 1">1</a>
            </li>
            <li>
              <a href="#" class="pagination-link 
                  is-current" aria-label="Goto page 2" 
                  aria-current="page">2</a>
            </li>
            <li>
              <a href="#" class="pagination-link" 
                aria-label="Goto page 3">3</a>
            </li>
            <li>
              <a href="#" class="pagination-link" 
                aria-label="Goto page 4">4</a>
            </li>
            <li>
              <a href="#" class="pagination-link" 
                aria-label="Goto page 5">5</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 6">6</a>
            </li>
          </ul>
        </nav>
      </div>
    </div>
  </div>
</body>
  
</html>

Output:

Example 2: This example shows pagination of large number of pages.




<!DOCTYPE html>
<html>
  
<head>
  <title>Bulma Pagination</title>
  <link rel='stylesheet' href=
  
  <!-- custom css -->
  <style>
    div.columns {
      margin-top: 80px;
    }
  </style>
</head>
  
<body>
  <div class='container'>
    <div class='columns is-mobile is-centered'>
      <div class='column is-10'>
        <nav class="pagination" role="navigation" 
            aria-label="pagination">
          <a class="pagination-previous">Previous</a>
          <a class="pagination-next">Next page</a>
          <ul class="pagination-list">
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 1">1</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 2">2</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 3">3</a>
            </li>
            <li>
              <span class="pagination-ellipsis">
                
              </span>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 26">26</a>
            </li>
            <li>
              <a class="pagination-link is-current" 
                  aria-label="Page 27" 
                  aria-current="page">27</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 28">28</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 29">29</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 30">30</a>
            </li>
          </ul>
        </nav>
      </div>
    </div>
  </div>
</body>
  
</html>

Output:



Example 3: This example shows pagination with different alignment.




<!DOCTYPE html>
<html>
  
<head>
  <title>Bulma Pagination</title>
  <link rel='stylesheet' href=
  
  <!-- custom css -->
  <style>
    div.columns {
      margin-top: 80px;
    }
  
    .pagination {
      margin-bottom: 20px;
    }
  </style>
</head>
  
<body>
  <div class='container'>
    <div class='columns is-mobile is-centered'>
      <div class='column is-10'>
        <nav class="pagination has-background-primary"
          role="navigation" aria-label="pagination">
          <a class="pagination-previous">Previous</a>
          <a class="pagination-next">Next page</a>
          <ul class="pagination-list">
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 1">1</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 2">2</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 3">3</a>
            </li>
            <li>
              <span class="pagination-ellipsis">
                
              </span>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 26">26</a>
            </li>
            <li>
              <a class="pagination-link is-current" 
                  aria-label="Page 27" 
                  aria-current="page">27</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 28">28</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 29">29</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 30">30</a>
            </li>
          </ul>
        </nav>
  
        <nav class="pagination is-centered 
            has-background-success" role="navigation"
            aria-label="pagination">
          <a class="pagination-previous">Previous</a>
          <a class="pagination-next">Next page</a>
          <ul class="pagination-list">
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 1">1</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 2">2</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 3">3</a>
            </li>
            <li>
              <span class="pagination-ellipsis">
                
              </span>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 26">26</a>
            </li>
            <li>
              <a class="pagination-link is-current" 
                  aria-label="Page 27" 
                  aria-current="page">27</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 28">28</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 29">29</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 30">30</a>
            </li>
  
          </ul>
        </nav>
  
        <nav class="pagination is-right 
            has-background-info" role="navigation" 
            aria-label="pagination">
          <a class="pagination-previous">Previous</a>
          <a class="pagination-next">Next page</a>
          <ul class="pagination-list">
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 1">1</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 2">2</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 3">3</a>
            </li>
            <li>
              <span class="pagination-ellipsis">
                
              </span>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 26">26</a>
            </li>
            <li>
              <a class="pagination-link is-current" 
                  aria-label="Page 27" 
                  aria-current="page">27</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 28">28</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 29">29</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 30">30</a>
            </li>
          </ul>
        </nav>
      </div>
    </div>
  </div>
</body>
  
</html>

Output:

Example 4: This example shows pagination with different sizes.




<!DOCTYPE html>
<html>
  
<head>
  <title>Bulma Pagination</title>
  <link rel='stylesheet' href=
  
  <!-- custom css -->
  <style>
    div.columns {
      margin-top: 80px;
    }
  
    .pagination {
      margin-bottom: 20px;
    }
  </style>
</head>
  
<body>
  <div class='container'>
    <div class='columns is-mobile is-centered'>
      <div class='column is-10'>
        <nav class="pagination is-small 
            has-background-primary" role="navigation"
            aria-label="pagination">
  
          <a class="pagination-previous">Previous</a>
          <a class="pagination-next">Next page</a>
          <ul class="pagination-list">
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 1">1</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 2">2</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 3">3</a>
            </li>
            <li>
              <span class="pagination-ellipsis">
                
              </span>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 26">26</a>
            </li>
            <li>
              <a class="pagination-link is-current" 
                  aria-label="Page 27" 
                  aria-current="page">27</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 28">28</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 29">29</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 30">30</a>
            </li>
          </ul>
        </nav>
        <nav class="pagination is-medium 
            has-background-success" role="navigation" 
            aria-label="pagination">
  
          <a class="pagination-previous">Previous</a>
          <a class="pagination-next">Next page</a>
          <ul class="pagination-list">
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 1">1</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 2">2</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 3">3</a>
            </li>
            <li>
              <span class="pagination-ellipsis">
                
              </span>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 26">26</a>
            </li>
            <li>
              <a class="pagination-link is-current" 
                  aria-label="Page 27" 
                  aria-current="page">27</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 28">28</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 29">29</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 30">30</a>
            </li>
          </ul>
        </nav>
  
        <nav class="pagination is-large 
            has-background-info" role="navigation" 
            aria-label="pagination">
          <a class="pagination-previous">Previous</a>
          <a class="pagination-next">Next page</a>
          <ul class="pagination-list">
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 1">1</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 2">2</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 3">3</a>
            </li>
            <li>
              <span class="pagination-ellipsis">
                
              </span>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 26">26</a>
            </li>
            <li>
              <a class="pagination-link is-current" 
                  aria-label="Page 27" 
                  aria-current="page">27</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 28">28</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 29">29</a>
            </li>
            <li>
              <a class="pagination-link" 
                  aria-label="Goto page 30">30</a>
            </li>
          </ul>
        </nav>
      </div>
    </div>
  </div>
</body>
  
</html>

Output:

Example 5: This example shows rounded pagination feature.




<!DOCTYPE html>
<html>
  
<head>
  <title>Bulma Pagination</title>
  <link rel='stylesheet' href=
  
  <!-- custom css -->
  <style>
    div.columns {
      margin-top: 80px;
    }
  
    .pagination {
      margin-bottom: 20px;
    }
  </style>
</head>
  
<body>
  <div class='container'>
    <div class='columns is-mobile is-centered'>
      <div class='column is-10'>
        <nav class="pagination is-rounded" 
          role="navigation" aria-label="pagination">
  
          <a class="pagination-previous">Previous</a>
          <a class="pagination-next">Next page</a>
          <ul class="pagination-list">
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 1">1</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 2">2</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 3">3</a>
            </li>
            <li>
              <span class="pagination-ellipsis">
                
              </span>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 26">26</a>
            </li>
            <li>
              <a class="pagination-link is-current" 
                  aria-label="Page 27" 
                  aria-current="page">27</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 28">28</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 29">29</a>
            </li>
            <li>
              <a class="pagination-link" 
                aria-label="Goto page 30">30</a>
            </li>
          </ul>
        </nav>
      </div>
    </div>
  </div>
</body>
  
</html>

Output:

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :