Black Friday is here 🔥 Get Wensity Pro for 20% less with

Pagination

A React pagination component with smart ellipses, a gliding active page, first and last buttons, a compact counter, and a load more button variant.

Loading preview

Examples

Practical examples and common states for the same installable component.

Default

Classic numbered pages with a sliding active indicator.

examples/pagination-default.tsx
"use client";
import { useState } from "react";
import { Pagination } from "@/components/wensity/pagination";
export function PaginationDefault() {
const [page, setPage] = useState(1);
return <Pagination page={page} totalPages={10} onPageChange={setPage} />;
}

Compact

Minimal page counter with prev/next arrows.

examples/pagination-compact.tsx
"use client";
import { useState } from "react";
import { Pagination } from "@/components/wensity/pagination";
export function PaginationCompact() {
const [page, setPage] = useState(1);
return <Pagination variant="compact" page={page} totalPages={10} onPageChange={setPage} />;
}

With First & Last

Four-button navigation with first/last page jump controls.

examples/pagination-with-first-last.tsx
"use client";
import { useState } from "react";
import { Pagination } from "@/components/wensity/pagination";
export function PaginationWithFirstLast() {
const [page, setPage] = useState(5);
return <Pagination variant="with-first-last" page={page} totalPages={20} onPageChange={setPage} />;
}

Load More

Single button for progressive loading with a bottom progress bar.

examples/pagination-load-more.tsx
"use client";
import { useState } from "react";
import { Pagination } from "@/components/wensity/pagination";
export function PaginationLoadMore() {
const [count, setCount] = useState(10);
const [loading, setLoading] = useState(false);
return (
<Pagination
variant="load-more"
page={1}
totalPages={5}
onPageChange={() => {}}
isLoading={loading}
hasMore={count < 50}
onLoadMore={() => {
setLoading(true);
setTimeout(() => { setCount(c => Math.min(c + 10, 50)); setLoading(false); }, 1500);
}}
loadedCount={count}
totalCount={50}
/>
);
}

Overview

Pagination is a React and Tailwind CSS pagination component, in Next.js or any React app, for tables, search results, and feeds. Pass page, totalPages, and onPageChange, and it works out the numbers and ellipses, with siblingCount setting the neighbours per side. The active page marker glides to the new number with Framer Motion, or jumps under reduced motion. Variants add first and last buttons, a compact 3 / 12 counter, or a Load more button above a Showing x of y line. Page numbers start at 1, so convert if your API counts from zero.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add pagination

Usage

Import Pagination from @/components/wensity/pagination and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
"use client";
import { useState } from "react";
import { Pagination } from "@/components/wensity/pagination";
export function PaginationDemo() {
const [page, setPage] = useState(1);
return (
<Pagination
page={page}
totalPages={10}
onPageChange={setPage}
/>
);
}

Props

PropTypeDefaultDescription
pagenumber-Current page, 1-indexed. Required.
totalPagesnumber-Total number of pages. Required.
onPageChange(page: number) => void-Called when the active page changes. Required.
variant"default" | "compact" | "with-first-last" | "load-more""default"Control set to render. load-more swaps pages for a single button.
size"sm" | "md""md"Control height and text size.
siblingCountnumber1Page links shown either side of the current page.
isLoadingbooleanfalseShows a busy state on the load-more button.
hasMorebooleantrueWhether more items remain, for the load-more variant.
onLoadMore() => void-Called when the load-more button is pressed.
  • Cover Flow Carousel component preview

    Cover Flow Carousel

    A 3D Cover Flow album carousel where side cards swing into the center and a mini player below follows the track.

  • Card Stack Carousel component preview

    Card Stack Carousel

    A React card stack carousel on Framer Motion: each photo drops out below the pile, slips behind it and rises to the back.

  • Orbital Image Carousel component preview

    Orbital Image Carousel

    Drag a cylindrical photo rail with snapped inertia, keyboard stepping, and depth-aware parallax on every face.

  • Animated Tabs component preview

    Animated Tabs

    A physical stack of photo cards shuffled to the front by clipped tabs, with a tight image inset and copy in the footer.