Skip to content

shadcn.io is an independent project built on shadcn/ui

Simple Page Numbers Pagination for Vue

Three page links, 1 to 3, with page 2 current and the default gap. There is no Previous and no Next.

UI library: Ark UI

The row is pages 1, 2, and 3. Page 2 is current. Spacing is the default. There is no Previous, Next, or ellipsis.

Use it for a short set where Previous and Next would add more than they help. The compact row is the same links with a tighter gap. A longer set can jump from a Select. In Vue, Ark UI marks a page current only when you say so.

Preview

Preview width

Installation

MCP · Pro
Make your AI a shadcn expert
Your agent installs components, builds pages and restyles your app from one prompt, in Claude Code, Cursor or VS Code.
Part of Pro

Anatomy

Pagination anatomy: root, previous, item, ellipsis, next

Usage

<Pagination>
  <PaginationContent>
    <PaginationItem><PaginationLink href="#">1</PaginationLink></PaginationItem>
    <PaginationItem>
      <PaginationLink href="#" :isActive="true">2</PaginationLink>
    </PaginationItem>
    <PaginationItem><PaginationLink href="#">3</PaginationLink></PaginationItem>
  </PaginationContent>
</Pagination>

FAQ

What does this simple row render?

Three PaginationLinks, numbered 1, 2 and 3. Page 2 has isActive. There is no Previous, Next, or ellipsis, and PaginationContent has no gap class.

How does isActive change page 2?

It selects the outline variant and sets aria-current="page". Pages 1 and 3 stay ghost. Move isActive to the link that should be current.

How do I link 1, 2 and 3 to real URLs?

Each href is #. Set it to that page's URL. Pagination is a nav labeled "pagination".

How do I tighten or loosen the three links?

Put a gap class on PaginationContent. This file does not, so the gap comes from the cn-pagination-content style (gap-0.5 or gap-1, depending on the style).

How do I add a fourth page?

Add another PaginationItem with a PaginationLink. Keep a single isActive on the current page. The links in this file are written out one by one.

What does assistive tech hear?

The link text is the number, and the current link has aria-current="page". The landmark name is "pagination", from aria-label on the nav.

API Reference

Pagination

Sets href="#" and isActive. The rest is on the Pagination page.