Pagination


A Pagination component is used to indicate that a series of related content exists across multiple pages.

API Documentation

How it works #

The Pagination component provides navigation for content split across multiple pages, allowing users to move between them easily.

How to use:
  1. Add the Pagination component to your page.
  2. Set the TotalPages parameter to specify the number of pages.
  3. Optionally, set ActivePageNumber to control which page is currently selected.
This demo shows several basic pagination setups with different page counts, demonstrating how the component adapts to various scenarios.
<Pagination TotalPages="3" />
<Pagination TotalPages="8" />
<Pagination TotalPages="10" />
<Pagination TotalPages="13" />

Alignment #

The Pagination component supports alignment options to fit your layout needs.

How to use:
  1. Use the Alignment parameter to set the pagination's position: Left (default), Center, or Right.
  2. Combine with ActivePageNumber and TotalPages as needed.
This demo illustrates left, center, and right-aligned pagination controls.
<Pagination ActivePageNumber="2" TotalPages="5" />
<Pagination ActivePageNumber="2" TotalPages="5" Alignment="PaginationAlignment.Center" />
<Pagination ActivePageNumber="2" TotalPages="5" Alignment="PaginationAlignment.Right" />

Styles #

The Pagination component can be styled for a rounded appearance.

How to use:
  1. Set the IsRounded parameter to true for rounded pagination buttons.
  2. Adjust ActivePageNumber and TotalPages as needed for your scenario.
This demo displays pagination with rounded styles at different active pages.
<Pagination ActivePageNumber="1" TotalPages="10" IsRounded="true" />
<Pagination ActivePageNumber="3" TotalPages="10" IsRounded="true" />
<Pagination ActivePageNumber="5" TotalPages="10" IsRounded="true" />

Sizes #

The Pagination component supports different sizes to match your UI requirements.

How to use:
  1. Use the Size parameter to set the pagination size: PaginationSize.Small, default (medium), or PaginationSize.Large.
  2. Combine with other parameters like ActivePageNumber and TotalPages as needed.
This demo shows small, default, and large pagination controls for comparison.
<Pagination ActivePageNumber="5" TotalPages="5" Size="PaginationSize.Small" />
<Pagination ActivePageNumber="5" TotalPages="5" />
<Pagination ActivePageNumber="5" TotalPages="5" Size="PaginationSize.Large" />

Events #

The Pagination component supports event handling to respond to page changes.

How to use:
  1. Bind the ActivePageNumber parameter to a variable in your code.
  2. Handle the PageChanged event to update your state when the user selects a different page.
  3. Update your UI or perform actions in the event handler as needed.
This demo demonstrates how to track and respond to page changes using event callbacks.
Current Page Number: 2
<Pagination ActivePageNumber="@currentPageNumber"
            TotalPages="10"
            PageChanged="OnPageChangedAsync" />

<text>Current Page Number: @currentPageNumber</text>

@code {
    int currentPageNumber = 2;

    private Task OnPageChangedAsync(int newPageNumber)
    {
        currentPageNumber = newPageNumber;
        return Task.CompletedTask;
    }
}
DO YOU KNOW?
This demo website is built using the BlazorExpress.Bulma library and published on the Azure Web App. See our source code on GitHub.