adit-firdaus

Pagination

Navigation

About

A numeric page navigator with an animated sliding highlight on the current page, that collapses into a compact "Page X of Y" readout when there isn't room for the full row of page keys.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Pagination to your project and fits it to your theme.

Code

How Pagination is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import * as React from "react";
import Pagination from "@/components/ui/pagination";

function Row({ initialPage }: { initialPage: number }) {
  const [page, setPage] = React.useState(initialPage);
  return <Pagination page={page} pageCount={24} onPageChange={setPage} />;
}

export default function PaginationWindowingDemo() {
  return (
    <div className="flex w-full flex-col items-center justify-center gap-4 p-10">
      {[1, 4, 8, 24].map((initialPage) => (
        <Row key={initialPage} initialPage={initialPage} />
      ))}
    </div>
  );
}

Dependencies

More by adit-firdaus

View all
  • Steps

    Steps

    46
  • Popover

    Popover

    4
  • Adaptive Sheet

    Adaptive Sheet

    2
  • Notice Bar

    Notice Bar

    2
  • Adaptive Card

    Adaptive Card

  • Box

    Box

  • Label

    Label

  • Kbd

    Kbd

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    100
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    295
  • Sidebar

    Sidebar

    422
  • Pagination with Ellipsis

    Pagination with Ellipsis

    25
  • Pagination

    Pagination

    3
  • Tabs

    Tabs

    33
  • Menu

    Menu

    23
  • Breadrcrumb

    Breadrcrumb

    6