Pagination

x-pagination

Page navigation with previous/next controls and a windowed list of page numbers (with ellipses). Feed it the current and total pages from your paginator.

php artisan components:add pagination

Examples

Basic

Previous/next controls with a windowed list of page numbers.

<div class="flex w-full items-center justify-center">
    <x-components.pagination :current-page="4" :total-pages="10" base-url="" />
</div>

Props

Prop Type Default Description
currentPage text 1 The active page number.
totalPages text 1 Total number of pages.
baseUrl text Base URL for page links; defaults to the current request URL with a ?page= query.