Bulma | Pagination - GeeksforGeeks

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.
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='https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>    <!-- 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='https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>    <!-- 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='https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>    <!-- 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='https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>    <!-- 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='https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>    <!-- 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.
Bulma
CSS
HTML
Web Technologies
HTML
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to insert spaces/tabs in text using HTML/CSS?
How to create footer to stay at the bottom of a Web page?
How to update Node.js and NPM to next version ?
CSS to put icon inside an input element in a form
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to insert spaces/tabs in text using HTML/CSS?
How to set the default value for an HTML <select> element ?
How to update Node.js and NPM to next version ?
How to set input type date in dd-mm-yyyy format using HTML ?