Logo

Pagination

Page navigation primitives with previous, next, active links, ellipsis, disabled states, dropdown pairing, and RTL support.

Preview

Showing page 6 of 12

Usage

TS

import { signal } from '@angular/core';
import { FrPaginationModule } from '@frame-ui-ng/components/pagination';

readonly totalPages = 12;
readonly currentPage = signal(6);

HTML

<p>Showing page {{ currentPage() }} of {{ totalPages }}</p>

<nav
  frPagination
  #pagination="frPagination"
  aria-label="Pagination"
  [(page)]="currentPage"
  [totalPages]="totalPages"
>
  <ul frPaginationContent>
    <li frPaginationItem>
      <button frPaginationPrevious type="button"></button>
    </li>

    @for (page of pagination.pages(); track $index) {
      <li frPaginationItem>
        @if (page === 'ellipsis') {
          <span frPaginationEllipsis></span>
        } @else {
          <button frPaginationLink type="button" [page]="page">
            {{ page }}
          </button>
        }
      </li>
    }

    <li frPaginationItem>
      <button frPaginationNext type="button"></button>
    </li>
  </ul>
</nav>

Examples

Basic

Keep page state in your component and render a small window around the current page with ellipsis gaps.

Showing page 6 of 12

Simple

A simple pagination with only page numbers.

Icons Only

Project custom icons into previous and next controls for compact table pagination.

Rows per page

Rows per page

Pair pagination with the dropdown menu primitive for rows-per-page controls.

Disabled

Disable unavailable page controls with the disabled input.

Custom Styling

Override pagination tokens to customize link shape, active treatment, hover color, and focus ring.

Token Inspector

Inspect the pagination root, content, links, active state, controls, and ellipsis.

Design Tokens

Pagination defines tokens for layout spacing, link sizing, active and hover states, disabled opacity, focus ring, and ellipsis color.

SCSS


  --frame-pagination-gap: 0.25rem;
  --frame-pagination-color: var(--frame-foreground);
  --frame-pagination-link-size: 2.25rem;
  --frame-pagination-link-min-width: 2.25rem;
  --frame-pagination-link-padding-x: 0.75rem;
  --frame-pagination-link-gap: 0.375rem;
  --frame-pagination-link-radius: var(--frame-radius-md);
  --frame-pagination-link-bg: transparent;
  --frame-pagination-link-color: var(--frame-muted-foreground);
  --frame-pagination-link-border: transparent;
  --frame-pagination-link-hover-bg: var(--frame-accent);
  --frame-pagination-link-hover-color: var(--frame-accent-foreground);
  --frame-pagination-link-active-bg: var(--frame-surface);
  --frame-pagination-link-active-color: var(--frame-foreground);
  --frame-pagination-link-active-border: var(--frame-border);
  --frame-pagination-link-disabled-opacity: 0.5;
  --frame-pagination-ellipsis-color: var(--frame-muted-foreground);