Please use Desktop to view and interact with components
Components400mseaseOut
Animated List
List with staggered item animations
liststaggercheckmarksshadcn
Useto navigate between components
Preview
- Design
- Development
- Testing
- Deployment
This component requires shadcn/ui
This component uses shadcn/ui components. Make sure you have shadcn/ui set up in your project.
- Install shadcn/ui:
npx shadcn-ui@latest init - Install required components based on the imports in the code (e.g.,
npx shadcn-ui@latest add button) - Ensure your
tailwind.config.tsandglobals.cssare configured as per shadcn/ui documentation
Code
TypeScript + React
'use client'
import { motion } from 'framer-motion'
import { Card } from '@/components/ui/card'
import { CheckCircle2 } from 'lucide-react'
const items = ['Design', 'Development', 'Testing', 'Deployment']
export function AnimatedList() {
return (
<Card className="w-64 p-4">
<ul className="space-y-2">
{items.map((item, index) => (
<motion.li
key={item}
initial={{ opacity: 0, x: -20 }}
animate={{ opacity: 1, x: 0 }}
transition={{ delay: index * 0.1, duration: 0.3 }}
className="flex items-center gap-2 rounded-md border bg-[var(--card-bg)] p-3"
>
<motion.div
initial={{ scale: 0 }}
animate={{ scale: 1 }}
transition={{ delay: index * 0.1 + 0.2, type: 'spring' }}
>
<CheckCircle2 className="h-4 w-4 text-green-500" />
</motion.div>
<span className="text-sm">{item}</span>
</motion.li>
))}
</ul>
</Card>
)
}
How to Use
- 1Install Framer Motion:
npm install framer-motion - 2Set up shadcn/ui: Install shadcn/ui components used in this code. Check the imports in the code above and install the required components (e.g.,
npx shadcn-ui@latest add button card) - 3Copy the code from above
- 4Paste it into your project and customize as needed
- 5Colors are customizable via Tailwind CSS classes. The default theme uses dark mode colors defined in your globals.css file