> ## Documentation Index
> Fetch the complete documentation index at: https://filament-34a8cf01.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination Blade component

> [!WARNING]
>
> You are currently viewing the documentation for Filament 4.x, which is a previous version of Filament.
>
> Looking for the current stable version? Visit the [5.x documentation](https://filament-34a8cf01.mintlify.site/5.x/components/pagination.md).

## Introduction

The pagination component can be used in a Livewire Blade view only. It can render a list of paginated links:

```php theme={"theme":"gruvbox-dark-hard"}
use App\Models\User;
use Illuminate\Contracts\View\View;
use Livewire\Component;

class ListUsers extends Component
{
    // ...

    public function render(): View
    {
        return view('livewire.list-users', [
            'users' => User::query()->paginate(10),
        ]);
    }
}
```

```blade theme={"theme":"gruvbox-dark-hard"}
<x-filament::pagination :paginator="$users" />
```

Loading preview

![Pagination](https://filament-34a8cf01.mintlify.site/docs/images/4.x/light/components/pagination/simple.jpg)

Alternatively, you can use simple pagination or cursor pagination, which will just render a "previous" and "next" button:

```php theme={"theme":"gruvbox-dark-hard"}
use App\Models\User;

User::query()->simplePaginate(10)
User::query()->cursorPaginate(10)
```

Loading preview

![Simple pagination](https://filament-34a8cf01.mintlify.site/docs/images/4.x/light/components/pagination/simple-paginator.jpg)

## Allowing the user to customize the number of items per page

You can allow the user to customize the number of items per page by passing an array of options to the `page-options` attribute. You must also define a Livewire property where the user's selection will be stored:

```php theme={"theme":"gruvbox-dark-hard"}
use App\Models\User;
use Illuminate\Contracts\View\View;
use Livewire\Component;

class ListUsers extends Component
{
    public int | string $perPage = 10;
    
    // ...
    
    public function render(): View
    {
        return view('livewire.list-users', [
            'users' => User::query()->paginate($this->perPage),
        ]);
    }
}
```

```blade theme={"theme":"gruvbox-dark-hard"}
<x-filament::pagination
    :paginator="$users"
    :page-options="[5, 10, 20, 50, 100, 'all']"
    current-page-option-property="perPage"
/>
```

Loading preview

![Pagination with page size options](https://filament-34a8cf01.mintlify.site/docs/images/4.x/light/components/pagination/page-options.jpg)

## Displaying links to the first and the last page

Extreme links are the first and last page links. You can add them by passing the `extreme-links` attribute to the component:

```blade theme={"theme":"gruvbox-dark-hard"}
<x-filament::pagination
    :paginator="$users"
    extreme-links
/>
```

Loading preview

![Pagination with extreme links](https://filament-34a8cf01.mintlify.site/docs/images/4.x/light/components/pagination/extreme-links.jpg)

[Edit this page on GitHub](https://github.com/filamentphp/filament/edit/4.x/docs/12-components/03-pagination.md)

## Sponsored by

[Your logo here](https://github.com/sponsors/danharrin)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.