Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Pagination

Renders page navigation links for paginated content.

Installation

npx logic2b@next add pagination

Usage

import {
  Pagination,
  PaginationContent,
  PaginationItem,
  PaginationLink,
  PaginationNext,
  PaginationPrevious,
} from "@/components/ui/pagination"

<Pagination>
  <PaginationContent>
    <PaginationItem>
      <PaginationPrevious href="#" />
    </PaginationItem>
    <PaginationItem>
      <PaginationLink href="#">1</PaginationLink>
    </PaginationItem>
    <PaginationItem>
      <PaginationNext href="#" />
    </PaginationItem>
  </PaginationContent>
</Pagination>

Usage notes

Pagination is a set of styled elements — the parts are plain nav, ul, li, and a wrappers, so they accept the usual HTML attributes (href, onClick, etc.).

Examples

Previous / next only

With ellipsis

Live playground

Edit the component props and inspect the exact JSX before copying it. The preview loads only when this section enters the viewport.

Generated JSX
<Pagination
  className="justify-center"
>
  <PaginationContent>
    <PaginationItem>
      <PaginationPrevious
        href="#"
       />
    </PaginationItem>
    <PaginationItem>
      <PaginationLink
        href="#"
      >1</PaginationLink>
    </PaginationItem>
    <PaginationItem>
      <PaginationLink
        href="#"
        isActive
      >2</PaginationLink>
    </PaginationItem>
    <PaginationItem>
      <PaginationLink
        href="#"
      >3</PaginationLink>
    </PaginationItem>
    <PaginationItem>
      <PaginationNext
        href="#"
       />
    </PaginationItem>
  </PaginationContent>
</Pagination>

API reference

Generated from the public TypeScript exports in src/ui/pagination.tsx.

View JSON

Pagination

Component
Props: React.ComponentProps<"nav">

PaginationContent

Component
Props: React.ComponentProps<"ul">
Component
Props: PaginationLinkProps
PropTypeRequiredDefaultDescription
isActivebooleanNo——
sizenull | "default" | "sm" | "lg" | "icon"No"icon"—

PaginationItem

Component
Props: React.ComponentProps<"li">

PaginationPrevious

Component
Props: React.ComponentProps<typeof PaginationLink>

PaginationNext

Component
Props: React.ComponentProps<typeof PaginationLink>

PaginationEllipsis

Component
Props: React.ComponentProps<"span">

Accessibility contract

Machine-readable behavior and consumer responsibilities for pagination.

View JSON
Support
Composition contract
Pattern
pagination navigation
HTML nav/anchor/button
Keyboard interactions for pagination
KeysBehavior
Enter SpaceActivate the focused control.

Built-in semantics

  • The root is a navigation landmark and the active page can expose aria-current=page.

Consumer responsibilities

  • Give the nav an aria-label and accessible labels to previous/next/icon-only links.