Pagination

How it works

Documentation and examples for showing pagination to indicate a series of related content exists across multiple pages. We use a large block of connected links for our pagination, making links hard to miss and easily scalable—all while providing large hit areas. Pagination is built with list HTML elements so screen readers can announce the number of available links.

Basic example

Use the border spinners for a lightweight loading indicator.

<x-pagination>
    <x-pagination.item label="Previous" disabled />
    <x-pagination.item to="/docs/components/pagination?page=1" label="1" />
    <x-pagination.item to="/docs/components/pagination?page=2" label="2" />
    <x-pagination.item to="/docs/components/pagination?page=3" label="3" />
    <x-pagination.item to="/docs/components/pagination?page=4" label="Next" />
</x-pagination>
<ul class="pagination">
  <li class="page-item disabled">
    <a class="page-link">Previous</a>
  </li>

  <li class="page-item">
    <a href="https://docs.laraloop.com/docs/components/pagination?page=1"
        class="page-link">1</a>
  </li>

  <li class="page-item">
    <a href="https://docs.laraloop.com/docs/components/pagination?page=2"
        class="page-link">2</a>
  </li>

  <li class="page-item">
    <a href="https://docs.laraloop.com/docs/components/pagination?page=3"
        class="page-link">3</a>
  </li>

  <li class="page-item">
    <a href="https://docs.laraloop.com/docs/components/pagination?page=4"
        class="page-link">Next</a>
  </li>
</ul>

Important notes regarding active status

.page-link  {
    &.active,
    .active > & {
        z-index: 3;
        color: $pagination-active-color;
        @include gradient-bg($pagination-active-bg);
        border-color: $pagination-active-border-color;
    }

    &.disabled,
    .disabled > & {
        color: $pagination-disabled-color;
        pointer-events: none;
        background-color: $pagination-disabled-bg;
        border-color: $pagination-disabled-border-color;
    }
}

You should find also this code commented in file resources/scss/bootstrap/_pagination.scss.