Pagination
Navigate a series of related pages.
Examples
Navigate a series of related pages
React code
import { Pagination } from "@accelerate/react/components";
export function Example() {
return (
<>
<Pagination aria-label="Example page navigation">
<a href="/components/">1</a>
<a href="/components/pagination/" aria-current="page">2</a>
<a href="/components/popover/">3</a>
</Pagination>
</>
);
}Angular code
import { Component } from "@angular/core";
import { AccPagination } from "@accelerate/angular/components";
@Component({
selector: "app-example",
imports: [
AccPagination,
],
template: `
<nav accPagination aria-label="Example page navigation">
<a href="/components/">1</a>
<a href="/components/pagination/" aria-current="page">2</a>
<a href="/components/popover/">3</a>
</nav>
`,
})
export class Example {}Installation
Source preview. The expanded component catalog is ahead of the public npm releases. To run these examples in your own application, use packages built from the SDK source used for the previews or a release that includes the APIs below.
- React
@accelerate/ui@0.4.0and@accelerate/react@0.4.0- Angular
@accelerate/ui@0.4.0and@accelerate/angular@0.2.0
Load @accelerate/ui/theme.css and put acc-theme on the app or the region using Accelerator components. See the framework setup guide for the theme and adapter conventions.
Usage
Provide a label and links or buttons. Mark the active page with aria-current="page". State and routing belong to the consumer.
Import the React component Pagination from @accelerate/react/components. For Angular, add AccPagination to the standalone component’s imports and use <nav accPagination>.
Examples use these React parts: Pagination. The Angular examples show the corresponding directives and template hosts.
API reference
- aria-current
- Set page on the current destination.
- Page state
- Routing and data loading belong to the application.