Skip to content

Pagination component#90

Merged
albx merged 18 commits into
mainfrom
feature/8-pagination-component
May 23, 2026
Merged

Pagination component#90
albx merged 18 commits into
mainfrom
feature/8-pagination-component

Conversation

@albx
Copy link
Copy Markdown
Owner

@albx albx commented May 17, 2026

This pull request introduces a new, fully-featured pagination component to the BitBlazor library, including all supporting types and documentation. The changes add both the main BitPagination component and the supporting BitPageItem subcomponent, as well as enums and state structures to control pagination behavior and appearance. The code is well-documented and includes support for accessibility, custom templates, and advanced features like jump-to-page and different view modes.

New Pagination Component Implementation

  • Added the BitPagination component (BitPagination.razor and .razor.cs) with support for customizable page navigation, alignment, templates, accessibility features, and advanced options like jump-to-page and simple/full view modes. [1] [2]
  • Introduced the BitPageItem subcomponent (BitPageItem.razor and .razor.cs) to represent individual page links, managing accessibility attributes and click handling. [1] [2]

Supporting Types and Enums

  • Added the PaginationAlignment enum to specify left, center, or right alignment of pagination controls.
  • Added the PaginationViewMode enum to switch between default (full) and simple pagination UI modes.
  • Added the PaginationState record struct to encapsulate current page and total pages, with helpers for first/last page detection.

Project Configuration

  • Updated the project file (BitBlazor.csproj) to make internals visible to the test project, enabling better unit testing of internal components.

@albx albx linked an issue May 17, 2026 that may be closed by this pull request
@albx albx requested a review from Copilot May 21, 2026 16:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Pagination feature set to the BitBlazor component library, including the core BitPagination component, its BitPageItem subcomponent, supporting enums/state types, plus Stories and bUnit test coverage.

Changes:

  • Added BitPagination + BitPageItem components with full/simple view modes, optional ellipsis, jump-to-page, templates, and alignment support.
  • Added supporting types: PaginationAlignment, PaginationViewMode, and PaginationState.
  • Added rendering/behavior tests and a Stories page; updated BitBlazor.csproj to expose internals to the test assembly.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Rendering.razor Adds markup-based rendering coverage for default/alignment/disabled/templates/jump-to-page/simple mode.
tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Behaviors.cs Adds interaction tests for clicking pages/prev/next, ellipsis sequencing, and jump-to-page behavior.
stories/BitBlazor.Stories/Components/Stories/Components/BitPagination.stories.razor Introduces Storybook examples demonstrating the new pagination API and templates.
src/BitBlazor/Components/Pagination/PaginationViewMode.cs Adds view-mode enum (Default vs Simple).
src/BitBlazor/Components/Pagination/PaginationState.cs Adds a small state struct for current/total pages and helper flags.
src/BitBlazor/Components/Pagination/PaginationAlignment.cs Adds alignment enum for left/center/right layout.
src/BitBlazor/Components/Pagination/BitPagination.razor.cs Implements pagination logic, page sequencing, alignment classes, and jump-to-page behavior.
src/BitBlazor/Components/Pagination/BitPagination.razor Implements pagination markup and templating (full/simple mode, jump-to-page, total items).
src/BitBlazor/Components/Pagination/BitPageItem.razor.cs Implements page item behavior, current-page ARIA state, and disabled attributes.
src/BitBlazor/Components/Pagination/BitPageItem.razor Renders the clickable page item anchor used by the pagination component.
src/BitBlazor/BitBlazor.csproj Adds InternalsVisibleTo for BitBlazor.Test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/BitBlazor/Components/Pagination/BitPageItem.razor.cs
Comment thread src/BitBlazor/Components/Pagination/BitPageItem.razor.cs
Comment thread src/BitBlazor/Components/Pagination/BitPagination.razor.cs
Comment thread src/BitBlazor/Components/Pagination/BitPagination.razor.cs
Comment thread src/BitBlazor/Components/Pagination/BitPagination.razor
@albx albx marked this pull request as ready for review May 21, 2026 20:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated 6 comments.

Comment thread src/BitBlazor/Components/Pagination/BitPagination.razor Outdated
Comment thread docs/components/pagination.md Outdated
Comment thread src/BitBlazor/Components/Pagination/BitPagination.razor.cs Outdated
Comment thread tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Rendering.razor Outdated
@albx albx merged commit 6f9a5f6 into main May 23, 2026
4 checks passed
@albx albx deleted the feature/8-pagination-component branch May 23, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add the Pagination component

2 participants