Blazor.Pagination
1.0.0
See the version list below for details.
dotnet add package Blazor.Pagination --version 1.0.0
NuGet\Install-Package Blazor.Pagination -Version 1.0.0
<PackageReference Include="Blazor.Pagination" Version="1.0.0" />
paket add Blazor.Pagination --version 1.0.0
#r "nuget: Blazor.Pagination, 1.0.0"
// Install Blazor.Pagination as a Cake Addin #addin nuget:?package=Blazor.Pagination&version=1.0.0 // Install Blazor.Pagination as a Cake Tool #tool nuget:?package=Blazor.Pagination&version=1.0.0
Blazor.Pagination
A simple to use blazor component to implement a pagination based on Bootstrap 5.2.
Installation
You can install from Nuget using the following command:
Install-Package Blazor.Pagination
Or via the Visual Studio package manger.
Basic usage
Start by add the following using statement to your root _Imports.razor
.
@using Blazor.Pagination
To use the component, your page should define a public parameter for the current page. For example:
private int _page = 1;
[Parameter]
public int Page { get => _page; set => _page value < 1 ? 1 : value; }
Your site should be accessible with two routes. For example:
@page "/Customer"
@Page "/Customer/Page/{Page:int}"
Note: The route without a page directive should always default to 1. Make sure to check that Page is greater than or equal to 1.
The component expects you to provide three parameters. | Parameter | Type | Function |---|---|---| | Page | int | The currently active page | TotalItems | int | The total amount of available items | NavUrl | string | The base for the generated nav-links.
You can embed the component in your .razor
files like this:
<Pagination Page="Page"
TotalItems="TotalItems"
NavUrl="/Customer/Page/" />
To unify the use of the component, the component also provides the IHasPagination
interface. This contains all needed properties as well as a function to Load the data.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- Microsoft.AspNetCore.Components.Web (>= 7.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.