Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
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
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Unique identifier used to create IDs for the pagination parts. |
ids | PaginationElementIds | undefined | — | Overrides generated identifiers for individual parts. |
count | number | undefined | 1 | Total number of data items. |
page | number | undefined | — | Current page when controlled. Supports Angular two-way binding. |
defaultPage | number | undefined | 1 | Initial page when uncontrolled. |
pageSize | number | undefined | — | Items per page when controlled. Supports Angular two-way binding. |
defaultPageSize | number | undefined | 10 | Initial items per page when uncontrolled. |
siblingCount | number | undefined | 1 | Number of page items shown on each side of the current page. |
boundaryCount | number | undefined | 1 | Number 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". |
translations | PaginationIntlTranslations | undefined | — | Overrides accessible labels used by the controls. |
Use [(page)]="page" and [(pageSize)]="pageSize" for two-way binding, or pair each input with
its corresponding change output when using signals.
Outputs
| Output | Type | Description |
|---|---|---|
pageChange | number | undefined | Emits the updated controlled page. |
pageSizeChange | number | undefined | Emits the updated controlled page size. |
pageDetailsChange | PaginationPageChangeDetails | Emits details whenever the page changes. |
pageSizeDetailsChange | PaginationPageSizeChangeDetails | Emits details whenever the page size changes. |
[appPaginationItem]
| Input | Type | Default | Description |
|---|---|---|---|
value | number | required | Page number activated by the item. |
<span appPaginationEllipsis>
| Input | Type | Default | Description |
|---|---|---|---|
index | number | required | Zero-based index of the ellipsis in the page sequence. |
<app-pagination-previous> and <app-pagination-next>
| Input | Type | Default | Description |
|---|---|---|---|
class | string | "" | Additional classes applied to the control button. |
variant | ButtonVariant | "ghost" | Sets the button's visual style. |
size | ButtonSize | "default" | Sets the button size. |
text | string | "Previous" / "Next" | Sets the label. Use an empty string to render only the icon. |
<app-pagination-first> and <app-pagination-last>
| Input | Type | Default | Description |
|---|---|---|---|
class | string | "" | Additional classes applied to the control button. |
text | string | "First" / "Last" | Sets the label. Use an empty string to render only the icon. |
Context, Providers, and Utilities
| Export | Angular API |
|---|---|
PaginationRootProvider | Directive [pagination-root-provider] providing an externally created API. |
PaginationContext | Structural 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. |
PaginationImports | Readonly collection containing the Angular pagination UI and context helpers. |
Types
| Export | Description |
|---|---|
PaginationApi | Connected pagination state and actions. |
PaginationElementIds | Overrides for generated pagination part IDs. |
PaginationIntlTranslations | Accessible text used by the pagination controls. |
PaginationMachineProps | Configuration accepted by the underlying state machine. |
PaginationPageChangeDetails | Details emitted by pageDetailsChange. |
PaginationPageSizeChangeDetails | Details emitted by pageSizeDetailsChange. |
PaginationPageUrlDetails | Details passed to getPageUrl. |
PaginationPages | Page and ellipsis entries produced by the machine. |
PaginationItemMachineProps | Properties used to connect a page item. |
PaginationEllipsisMachineProps | Properties used to connect an ellipsis item. |
UsePaginationOptions | Options accepted by usePagination. |
UsePaginationProps | Root properties supplied to usePagination. |
UsePaginationReturn | Signal-backed machine returned by usePagination. |
Angular
React
Solid
Svelte
Vue