Loading...
Installation
Usage
import StackPagination from "@/components/ruixen/stack-pagination";
export default function App() {
return <StackPagination totalPages={20} visibleCount={5} />;
}
Props
Prop | Type | Default | Description |
---|---|---|---|
totalPages | number | 20 | Total number of pages |
visibleCount | number | 5 | Number of cards visible in pagination |
className | string | "" | Additional CSS classes |
Features
- 3D Card Stack: Cards appear stacked with depth using z-transforms
- Flip Animation: Click cards to flip and see back content
- Perspective: Uses CSS perspective for 3D depth effect
- Smart Pagination: Shows ellipsis (...) for large page counts
- Hover Effects: Cards lift up on hover with z-axis translation
Interactions
- Click Card: Flip card to see back content
- Hover: Card lifts up with 3D transform
- Prev/Next Buttons: Navigate through pages
- Active State: Current page card appears elevated
3D Effects
The component uses CSS transforms for 3D effects:
perspective(1200px)
on containertransformStyle: "preserve-3d"
on cardsrotateY(180deg)
for flip animationz
translations for depth stacking