Docs
Pagination

Pagination

Pagination with page navigation, next and previous links.

Loading...
Loading...

Installation

npx shadcn-ng@latest add pagination
npm
yarn
pnpm
bun

Copy and paste the following code into your project.

Update the import paths to match your project setup.

Usage

import {
  UbPaginationContentDirective,
  UbPaginationDirective,
  UbPaginationEllipsisComponent,
  UbPaginationItemDirective,
  UbPaginationLinkDirective,
  UbPaginationNextDirective,
  UbPaginationPreviousDirective,
} from "@/components/ui/pagination"
<nav ubPagination>
  <ul ubPaginationContent>
    <li ubPaginationItem>
      <a href="#" ubPaginationPrevious></a>
    </li>
    <li ubPaginationItem>
      <a ubPaginationLink href="#">1</a>
    </li>
    <li ubPaginationItem>
      <a ubPaginationLink href="#" isActive>2</a>
    </li>
    <li ubPaginationItem>
      <a ubPaginationLink href="#">3</a>
    </li>
    <li ubPaginationItem>
      <ub-pagination-ellipsis />
    </li>
    <li ubPaginationItem>
      <a href="#" ubPaginationNext></a>
    </li>
  </ul>
</nav>