Skip to content

zk-pagination ​

Renders a <nav> with numbered page links. Preserves existing query parameters when navigating.

Props ​

PropTypeDefaultDescription
currentPageint1Currently active page number
totalPagesint1Total number of pages
pageParamstring'page'Query parameter name in the URL
ariaLabelstring'Pagination'aria-label on the <nav> element
classstring|nullnullCSS class(es) on the <nav> element

Examples ​

Basic ​

blade
<x-zk-pagination
    :currentPage="$currentPage"
    :totalPages="$totalPages" />

With search filters preserved ​

blade
{{-- URL: /products?search=shoes&page=2 --}}
<x-zk-pagination
    :currentPage="$products->currentPage()"
    :totalPages="$products->lastPage()" />
{{-- Previous/Next links preserve ?search=shoes --}}

Custom query param ​

blade
<x-zk-pagination
    :currentPage="$page"
    :totalPages="$total"
    pageParam="p" />
{{-- generates: ?p=2, ?p=3, etc. --}}

With Laravel paginator ​

blade
<x-zk-pagination
    :currentPage="$items->currentPage()"
    :totalPages="$items->lastPage()" />

Notes ​

  • URLs are built with request()->fullUrlWithQuery() — all existing query parameters are preserved.
  • aria-current="page" is set on the active page link.
  • Previous and Next links are hidden when at the first/last page respectively.
  • Labels are translated — see zairakai::layout.pagination.previous / next.

Documentation of 3.2.0 , built from c93e21f on 3.2.0 by pipeline #2919741884 on 2026-10-06.