# Compact

> Inline numbers from sm up, "Page X of Y" on mobile.

A shadcn/ui block from the [@flx](https://ui.flexnative.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/flx/pagination-02).

- Page, with a live preview: https://shadcn.exchange/r/flx/pagination-02
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/flx/pagination-02-light-8b7c1797576d8aab.png
- Registry item: https://ui.flexnative.com/r/pagination-02.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.flexnative.com/r/pagination-02.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `pagination`

## Files

### `registry/patterns/pagination/pagination-02.tsx`

```tsx
'use client'

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

export function Pagination02() {
  return (
    <Pagination>
      {/* Demo links — cancel navigation so the page does not jump */}
      <PaginationContent
        onClick={(e) => e.preventDefault()}
        className="w-full justify-between sm:w-auto sm:justify-center"
      >
        <PaginationItem>
          <PaginationPrevious href="#" />
        </PaginationItem>

        {/* Inline numbers from sm up */}
        <div className="hidden items-center gap-1 sm:flex">
          <PaginationItem>
            <PaginationLink href="#">1</PaginationLink>
          </PaginationItem>
          <PaginationItem>
            <PaginationLink href="#" isActive>
              2
            </PaginationLink>
          </PaginationItem>
          <PaginationItem>
            <PaginationLink href="#">3</PaginationLink>
          </PaginationItem>
        </div>

        {/* Text indicator on small screens */}
        <span className="text-muted-foreground text-sm font-medium tabular-nums sm:hidden">
          Page 2 of 3
        </span>

        <PaginationItem>
          <PaginationNext href="#" />
        </PaginationItem>
      </PaginationContent>
    </Pagination>
  )
}
```
