Get Started
Components
- Accordion
- Alert Dialog
- Alert
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button Group
- Button
- Card
- Carousel
- Checkbox
- Collapsible
- Combobox
- Command
- Container
- Context Menu
- Data Table
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Flex
- Form
- Grid
- Hero Button
- Hover Card
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Responsive
- Scroll Area
- Segmented Control
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spacer
- Spinner
- Squircle
- Switch
- Table
- Tabs
- Textarea
- Theme Toggle
- Toggle Group
- Toggle
- Tooltip
- Typography
- Unicorn Wrapper
Animations
- Background Image Parallax
- Card Swipe Carousel
- Cards Parallax
- Parallax Scroll
- Perspective Carousel
- Perspective Section Transition
- Scroll Expand
- Scroll Fade
- Scroll Scale
- Slide Down
- Slide Up
- Smooth Parallax Scroll
- Smooth Scroll
- Sticky Footer
- Text Along Path
- Text Gradient Opacity
- Text Parallax
- Transforms 3d
- Zoom Parallax
"use client"
import {
PerspectiveContainer,
PerspectiveSection,
} from "@/components/animations/perspective-section-transition/perspective-section-transition"
export function PerspectiveSectionTransitionDemo() {
return (
<PerspectiveContainer height="200vh">
{/* Section 1 - Shrinks and rotates as you scroll */}
<PerspectiveSection
scaleRange={[1, 0.8]}
rotateRange={[0, -5]}
sticky
className="bg-[#C72626] pb-[10vh] text-[3.5vw] text-white"
>
<p>Scroll Perspective</p>
<div className="flex items-center gap-4">
<p>Section</p>
<div className="relative h-[10vw] w-[12.5vw] overflow-hidden rounded-lg">
<img
src="https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400&h=300&fit=crop"
alt="Mountain landscape"
className="h-full w-full object-cover"
/>
</div>
<p>Transition</p>
</div>
</PerspectiveSection>
{/* Section 2 - Grows and straightens as you scroll */}
<PerspectiveSection
scaleRange={[0.8, 1]}
rotateRange={[5, 0]}
className="relative overflow-hidden"
>
<img
src="https://images.unsplash.com/photo-1469474968028-56623f02e42e?w=1920&h=1080&fit=crop"
alt="Nature landscape"
className="absolute inset-0 h-full w-full object-cover"
/>
</PerspectiveSection>
</PerspectiveContainer>
)
}
Installation
pnpm dlx pitsi@latest add perspective-section-transition
Usage
import { PerspectiveSectionTransition } from "@/components/animations/perspective-section-transition"