Blazor.Pagination 1.0.0

There is a newer version of this package available.
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                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Blazor.Pagination" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazor.Pagination --version 1.0.0                
#r "nuget: Blazor.Pagination, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.2 569 1/10/2023
2.0.1 285 1/10/2023
2.0.0 288 1/9/2023
1.0.0 303 12/20/2022