Search documentation

Search the documentation and open a page.

Displays a sequence of controls for navigating through pages.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/pagination

Composition

<app-pagination> └── [appPaginationContent] (optional) ├── <app-pagination-first> (optional) ├── <app-pagination-previous> ├── [appPaginationItem] ├── <span appPaginationEllipsis> (optional) ├── <app-pagination-next> └── <app-pagination-last> (optional)

Examples

Default

Loading...

Icons Only

Loading...

Previous And Next

Loading...

Rows Per Page

Loading...

With A List

Loading...

API Reference

<app-pagination>

Inputs

InputTypeDefaultDescription
idstring | undefinedgeneratedUnique identifier used to create IDs for the pagination parts.
idsPaginationElementIds | undefined—Overrides generated identifiers for individual parts.
countnumber | undefined1Total number of data items.
pagenumber | undefined—Current page when controlled. Supports Angular two-way binding.
defaultPagenumber | undefined1Initial page when uncontrolled.
pageSizenumber | undefined—Items per page when controlled. Supports Angular two-way binding.
defaultPageSizenumber | undefined10Initial items per page when uncontrolled.
siblingCountnumber | undefined1Number of page items shown on each side of the current page.
boundaryCountnumber | undefined1Number of page items always shown at the beginning and end.
type"button" | "link" | undefined`"button"Uses button or link behavior for the pagination controls.
getPageUrl((details: PaginationPageUrlDetails) => string) | undefined—Generates control URLs when type is "link".
translationsPaginationIntlTranslations | undefined—Overrides accessible labels used by the controls.

Outputs

OutputTypeDescription
pageChangenumber | undefinedEmits the updated controlled page.
pageSizeChangenumber | undefinedEmits the updated controlled page size.
pageDetailsChangePaginationPageChangeDetailsEmits details whenever the page changes.
pageSizeDetailsChangePaginationPageSizeChangeDetailsEmits details whenever the page size changes.

[appPaginationItem]

InputTypeDefaultDescription
valuenumberrequiredPage number activated by the item.

<span appPaginationEllipsis>

InputTypeDefaultDescription
indexnumberrequiredZero-based index of the ellipsis in the page sequence.

<app-pagination-previous> and <app-pagination-next>

InputTypeDefaultDescription
classstring""Additional classes applied to the control button.
variantButtonVariant"ghost"Sets the button's visual style.
sizeButtonSize"default"Sets the button size.
textstring"Previous" / "Next"Sets the label. Use an empty string to render only the icon.

<app-pagination-first> and <app-pagination-last>

InputTypeDefaultDescription
classstring""Additional classes applied to the control button.
textstring"First" / "Last"Sets the label. Use an empty string to render only the icon.

Context, Providers, and Utilities

ExportAngular API
PaginationRootProviderDirective [pagination-root-provider] providing an externally created API.
PaginationContextStructural directive [pagination-context] exposing the root API to a template.
usePagination(options?)Creates the signal-backed pagination machine in an Angular injection context.
injectPaginationContext()Injects the nearest pagination root context.
PaginationImportsReadonly collection containing the Angular pagination UI and context helpers.

Types

ExportDescription
PaginationApiConnected pagination state and actions.
PaginationElementIdsOverrides for generated pagination part IDs.
PaginationIntlTranslationsAccessible text used by the pagination controls.
PaginationMachinePropsConfiguration accepted by the underlying state machine.
PaginationPageChangeDetailsDetails emitted by pageDetailsChange.
PaginationPageSizeChangeDetailsDetails emitted by pageSizeDetailsChange.
PaginationPageUrlDetailsDetails passed to getPageUrl.
PaginationPagesPage and ellipsis entries produced by the machine.
PaginationItemMachinePropsProperties used to connect a page item.
PaginationEllipsisMachinePropsProperties used to connect an ellipsis item.
UsePaginationOptionsOptions accepted by usePagination.
UsePaginationPropsRoot properties supplied to usePagination.
UsePaginationReturnSignal-backed machine returned by usePagination.