Origin UI

Pagination with text buttons

Buttons 18

About

Pagination with text buttons

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

Code

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

Usage.tsx

import { useState } from "react";
import { TextPagination } from "@/components/ui/text-pagination";

const ITEMS_PER_PAGE = 4;
const TOTAL_ITEMS = 20;

function TextPaginationDemo() {
  const [currentPage, setCurrentPage] = useState(1);
  const totalPages = Math.ceil(TOTAL_ITEMS / ITEMS_PER_PAGE);

  const items = Array.from({ length: ITEMS_PER_PAGE }, (_, i) => ({
    id: (currentPage - 1) * ITEMS_PER_PAGE + i + 1,
    title: `Item ${(currentPage - 1) * ITEMS_PER_PAGE + i + 1}`,
  }));

  return (
    <div className="flex w-[300px] flex-col space-y-4 rounded-lg border p-4">
      <div className="space-y-2">
        {items.map((item) => (
          <div
            key={item.id}
            className="rounded-md bg-muted/50 p-2 text-sm"
          >
            {item.title}
          </div>
        ))}
      </div>

      <TextPagination
        currentPage={currentPage}
        totalPages={totalPages}
        onPageChange={setCurrentPage}
      />
    </div>
  );
}

export { TextPaginationDemo };

More by Origin UI

View all
  • Dialog

    Dialog

    1.3K
  • Avatar

    Avatar

    1K
  • useImageUpload

    useImageUpload

    950
  • usePagination

    usePagination

    635
  • Popover

    Popover

    390
  • Button

    Button

    381
  • Command

    Command

    344
  • Calendar [React Day Picker]

    Calendar [React Day Picker]

    270

More in Buttons

View all
  • Button

    Button

    12
  • Texture Button

    Texture Button

    105
  • Notification Button

    Notification Button

    115
  • HeroUI Button Group

    HeroUI Button Group

    2
  • App Store Button

    App Store Button

    481
  • Button

    Button

    78
  • Split Button

    Split Button

    16
  • Button

    Button

    5