Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/villainoustourist/blazor.pagination

A reusable pagination component for Blazor.
https://github.com/villainoustourist/blazor.pagination

asp-net-core blazor pagination

Last synced: about 1 month ago
JSON representation

A reusable pagination component for Blazor.

Awesome Lists containing this project

README

        

# Blazor.Pagination
A reusable pagination component for .NET Core Blazor.

[![Build Status](https://kfranken.visualstudio.com/Personal/_apis/build/status/Build%20%26%20Publish%20Blazor%20Pagination?branchName=master)](https://kfranken.visualstudio.com/Personal/_build/latest?definitionId=13&branchName=master)
[![Package Version](https://img.shields.io/nuget/v/BlazorPagination.svg)](https://www.nuget.org/packages/BlazorPagination/)
[![NuGet Downloads](https://img.shields.io/nuget/dt/BlazorPagination.svg)](https://www.nuget.org/packages/BlazorPagination/)
[![License](https://img.shields.io/github/license/villainoustourist/Blazor.Pagination.svg)](https://github.com/villainoustourist/Blazor.Pagination/blob/master/LICENSE)

## Installation

Add the BlazorPagination NuGet package to your .NET Core Blazor app using the following command in the Package Manager Console:
```
PM> Install-Package BlazorPagination
```
or using .NET CLI run the following command
```
dotnet add package BlazorPagination
```

Once you have installed the package add the following line in the ```_ViewImports.cshtml``` file
```
@addTagHelper *,BlazorPagination
```
## Usage

```
...
@using BlazorPagination
...


@foreach (var item in _data.Results)
{
@item
}

...
@code {
private PagedResult _data;
private string _filter;
private int _page = 1;
protected override OnInitialized()
{
_data = FetchData(_filter, _page);
}
}
```

Default HTML output:

```


```