Please use Desktop to view and interact with components
Page Transitions500msspring
Feature Grid Section
Animated feature grid with staggered card animations and icon reveals
featuresgridcardsstaggershadcn
Useto navigate between components
Preview
Why Choose Us
Everything you need to build amazing applications
Developer Friendly
Built with TypeScript and modern React patterns
Lightning Fast
Optimized animations that never lag
Production Ready
Tested and ready for your next project
Responsive
Works perfectly on all devices
Secure
Built with security best practices
Modern
Using the latest web technologies
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 { useRef } from 'react'
import { useInView } from 'framer-motion'
import { Code, Zap, Shield, Globe, Lock, Sparkles } from 'lucide-react'
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
const features = [
{
icon: Code,
title: 'Developer Friendly',
description: 'Built with TypeScript and modern React patterns',
},
{
icon: Zap,
title: 'Lightning Fast',
description: 'Optimized animations that never lag',
},
{
icon: Shield,
title: 'Production Ready',
description: 'Tested and ready for your next project',
},
{
icon: Globe,
title: 'Responsive',
description: 'Works perfectly on all devices',
},
{
icon: Lock,
title: 'Secure',
description: 'Built with security best practices',
},
{
icon: Sparkles,
title: 'Modern',
description: 'Using the latest web technologies',
},
]
export function FeatureGridSection() {
const ref = useRef(null)
const isInView = useInView(ref, { once: true, margin: '-50px' })
const containerVariants = {
hidden: { opacity: 0 },
visible: {
opacity: 1,
transition: {
staggerChildren: 0.1,
delayChildren: 0.2,
},
},
}
const itemVariants = {
hidden: { opacity: 0, y: 30, scale: 0.9 },
visible: {
opacity: 1,
y: 0,
scale: 1,
transition: {
type: 'spring',
stiffness: 100,
damping: 15,
},
},
}
return (
<div ref={ref} className="w-full px-4 py-16">
<div className="mx-auto max-w-6xl">
<motion.div
initial={{ opacity: 0, y: 30 }}
animate={isInView ? { opacity: 1, y: 0 } : { opacity: 0, y: 30 }}
transition={{ duration: 0.6 }}
className="mb-12 text-center"
>
<h2 className="mb-4 text-3xl font-bold sm:text-4xl md:text-5xl">Why Choose Us</h2>
<p className="text-sm text-[var(--foreground)]/70 sm:text-base md:text-lg">
Everything you need to build amazing applications
</p>
</motion.div>
<motion.div
variants={containerVariants}
initial="hidden"
animate={isInView ? 'visible' : 'hidden'}
className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3"
>
{features.map((feature, index) => {
const Icon = feature.icon
return (
<motion.div key={feature.title} variants={itemVariants}>
<Card className="h-full bg-[var(--card-bg)] transition-all hover:shadow-lg">
<CardHeader>
<motion.div
initial={{ scale: 0, rotate: -180 }}
animate={isInView ? { scale: 1, rotate: 0 } : { scale: 0, rotate: -180 }}
transition={{
delay: index * 0.1 + 0.3,
type: 'spring',
stiffness: 200,
}}
className="mb-4 inline-flex"
>
<Icon className="h-6 w-6 text-white" />
</motion.div>
<CardTitle className="text-xl">{feature.title}</CardTitle>
</CardHeader>
<CardContent>
<CardDescription className="text-base">{feature.description}</CardDescription>
</CardContent>
</Card>
</motion.div>
)
})}
</motion.div>
</div>
</div>
)
}
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