Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-pagination.json --yes

Pagination

Pro

The row of page numbers with previous and next under a long table or list, to move between its pages, for React and Tailwind CSS. Part of Goop Pro.

Turn the pages of twenty-three orders, two a page, by number or with Previous and Next; the ends switch off at the first and the last page, and a gap stands for the pages not shown, the row seven places on every page. The orders are our own sample rows in the page; nothing is fetched per page.

When to use

  • The row of page numbers with previous and next under a long table or list, to move between its pages.
  • Also called: pager.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Pagination on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-pagination.json --yes
PROMPT
Add the Goop Pagination to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import {
  Pagination, PaginationContent, PaginationList, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis, PaginationPages, pageRange,
} from '@/components/ui/goop/pagination';
import { useState } from 'react';

function NotesPages() {
  const [page, setPage] = useState(1);
  return (
    <>
      <Pagination aria-label="Pages of notes">
        <PaginationPages page={page} pageCount={12} href={(n) => `?page=${n}`} onPageChange={setPage} />
      </Pagination>
      {/* a hand-picked run of pages, written with the parts */}
      <Pagination>
        <PaginationContent>
          <PaginationItem>
            <PaginationPrevious href="?page=2" />
          </PaginationItem>
          <PaginationItem>
            <PaginationList>
              <PaginationItem>
                <PaginationLink href="?page=1">1</PaginationLink>
              </PaginationItem>
              <PaginationItem>
                <PaginationEllipsis />
              </PaginationItem>
              <PaginationItem>
                <PaginationLink href="?page=3" isActive>
                  3
                </PaginationLink>
              </PaginationItem>
              <PaginationItem>
                <PaginationLink href="?page=4">4</PaginationLink>
              </PaginationItem>
            </PaginationList>
          </PaginationItem>
          <PaginationItem>
            <PaginationNext href="?page=4" />
          </PaginationItem>
        </PaginationContent>
      </Pagination>
    </>
  );
}
  • Fits: list (its recipe).
  • PaginationPages: Every page is a real link to href(page); with onPageChange a plain click turns the page in place instead and the caller sets page. For a hand-picked run of pages write the parts: PaginationContent, PaginationList, PaginationLink.
  • height, width, padding, gap, text: add no class for these.

API reference

Options
OptionTypeWhat it does
Defaultsaria-label = 'Pagination'
Parts
PartWhat it is
PaginationContentThe row in Pagination; PaginationPrevious, a PaginationList, then PaginationNext, each in an item
PaginationListThe run of pages and gaps, a list of its own inside one item of the row, with the same gap between its places
PaginationItemOne place in the row or in its run
PaginationLinkA link to one page by its number, in a PaginationItem; mark the page shown with isActive; isActive?: boolean = false — This is the page shown: aria-current="page", and the pill's current look; pageLabel?: string — The word said before the page's number in its spoken name ("Page" 3, the default), the caller's to translate; also takes href?: string
PaginationPreviousThe link to the page before, as the theme's quiet 28 px link; label?: string = 'Previous' — The link's words and spoken name; disabled?: boolean = false — No page that way: the link stays, dimmed, but leads nowhere and takes no tab stop; also takes href?: string
PaginationNextThe link to the page after, as the theme's quiet 28 px link; label?: string = 'Next' — The link's words and spoken name; disabled?: boolean = false — No page that way: the link stays, dimmed, but leads nowhere and takes no tab stop; also takes href?: string
PaginationEllipsisThe pages left out; label?: string = 'More pages' — The dots' spoken name
PaginationPagesA ready pagination row that works out its own pages; its props: pagination--pages.md
  • pageRange
  • data-slot values (to select a part by): pagination, pagination-content, pagination-ellipsis, pagination-item, pagination-link, pagination-list, pagination-next, pagination-previous

PaginationPages

A ready pagination row that works out its own pages.

TSX
import { PaginationPages } from '@/components/ui/goop/pagination';

Options

  • page: number — The page shown, from 1.
  • pageCount: number — How many pages the list has.
  • siblings?: number = 1 — Pages shown either side of the page shown.
  • boundaries?: number = 1 — Pages always shown at each end.
  • href: (page: number) => string — The address of a page by its number ((n) => "?page=" + n): every page, previous and next link there.
  • onPageChange?: (page: number) => void — Called with the page a plain click asks for; the click's own navigation is stopped.
  • pageLabel?: string — The word said before each page's number ("Page" 3, the default), the caller's to translate.
  • previousLabel?: string = 'Previous' — Previous's words, the caller's to translate.
  • nextLabel?: string = 'Next' — Next's words, the caller's to translate.
  • gapLabel?: string = 'More pages' — What the dots stand for, said to a reader.

Keyboard

KeyWhat it does
TabMove to the next link

Accessibility

  • The part itself answers the keys above.

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
disabledthe attribute aria-disabled

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/trail/components/pagination.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-pagination.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.