Animated Pagination
tripled/animated-pagination-shadcnuiFreeComponent
Pagination with smooth page transition indicator
Install it
npx shadcn@latest add https://ui.tripled.work/r/animated-pagination-shadcnui.jsonSource
1"use client";23import { motion } from "framer-motion";4import { ChevronLeft, ChevronRight } from "lucide-react";5import { useState } from "react";67export function AnimatedPagination() {8 const [currentPage, setCurrentPage] = useState(1);9 const totalPages = 5;1011 return (12 <div className="flex items-center gap-2">13 <motion.button14 onClick={() => setCurrentPage(Math.max(1, currentPage - 1))}15 disabled={currentPage === 1}16 className="flex h-9 w-9 items-center justify-center rounded-lg border disabled:opacity-50"17 whileHover={{ scale: 1.05 }}18 whileTap={{ scale: 0.95 }}19 >20 <ChevronLeft className="h-4 w-4" />21 </motion.button>2223 {Array.from({ length: totalPages }, (_, i) => i + 1).map((page) => (24 <motion.button25 key={page}26 onClick={() => setCurrentPage(page)}27 className="relative h-9 w-9 rounded-lg text-sm font-medium"28 whileHover={{ scale: 1.05 }}29 whileTap={{ scale: 0.95 }}30 style={{31 color: currentPage === page ? "white" : "var(--foreground)",32 }}33 >34 {currentPage === page && (35 <motion.div36 layoutId="pagination-indicator"37 className="absolute inset-0 rounded-lg bg-accent"38 transition={{ type: "spring", stiffness: 380, damping: 30 }}39 />40 )}41 <span className="relative z-10">{page}</span>42 </motion.button>43 ))}4445 <motion.button46 onClick={() => setCurrentPage(Math.min(totalPages, currentPage + 1))}47 disabled={currentPage === totalPages}48 className="flex h-9 w-9 items-center justify-center rounded-lg border disabled:opacity-50"49 whileHover={{ scale: 1.05 }}50 whileTap={{ scale: 0.95 }}51 >52 <ChevronRight className="h-4 w-4" />53 </motion.button>54 </div>55 );56}
What it pulls in
npm packages
Other registry items
Files it writes
More from tripled
All 282 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| AI Chat Interfaceai-chat-interface-shadcnui | tripled | Components | Free | 2 deps | |
| AI Glow Inputai-glow-input-shadcnui | tripled | Components | Free | 2 deps | |
| AI Loading Skeletonai-loading-skeleton-shadcnui | tripled | Components | Free | 2 deps | |
| AI Response Typing Streamai-response-typing-shadcnui | tripled | Components | Free | 2 deps | |
| AI Unlock Animationai-unlock-animation-shadcnui | tripled | Components | Free | 2 deps | |
| Animated Accordionanimated-accordion-shadcnui | tripled | Components | Free | 2 deps | |
| Animated Card Stackanimated-card-stack-baseui | tripled | Components | Free | 2 deps | |
| Animated Card Stackanimated-card-stack-shadcnui | tripled | Components | Free | 2 deps |
