Please use Desktop to view and interact with components
Blocks500mseaseOut
Footer Block
Comprehensive footer with links, newsletter signup, social icons, and scroll-to-top
footerlinkssocialnewsletternavigationshadcn
Useto navigate between components
Preview
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 { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { Badge } from '@/components/ui/badge'
import {
Facebook,
Twitter,
Instagram,
Linkedin,
Github,
Mail,
MapPin,
Phone,
ArrowUp,
} from 'lucide-react'
const footerLinks = [
{
title: 'Product',
links: ['Features', 'Pricing', 'Documentation', 'API Reference'],
},
{
title: 'Company',
links: ['About Us', 'Careers', 'Blog', 'Press Kit'],
},
{
title: 'Resources',
links: ['Community', 'Help Center', 'Partners', 'Status'],
},
{
title: 'Legal',
links: ['Privacy', 'Terms', 'Cookie Policy', 'Licenses'],
},
]
const socialLinks = [
{ icon: Twitter, label: 'Twitter', href: '#' },
{ icon: Facebook, label: 'Facebook', href: '#' },
{ icon: Instagram, label: 'Instagram', href: '#' },
{ icon: Linkedin, label: 'LinkedIn', href: '#' },
{ icon: Github, label: 'GitHub', href: '#' },
]
export function FooterBlock() {
const scrollToTop = () => {
window.scrollTo({ top: 0, behavior: 'smooth' })
}
return (
<footer className="relative w-full border-t border-border bg-card">
{/* Main Footer Content */}
<div className="mx-auto max-w-7xl px-4 py-12">
<div className="grid gap-8 md:grid-cols-2 lg:grid-cols-6">
{/* Brand & Newsletter */}
<motion.div
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5 }}
className="lg:col-span-2"
>
<motion.div
whileHover={{ scale: 1.05 }}
transition={{ duration: 0.2 }}
className="mb-4"
>
<h3 className="text-2xl font-bold">Brand</h3>
</motion.div>
<p className="mb-4 text-sm text-muted-foreground">
Building amazing products with modern technologies. Join us on our
journey to create better user experiences.
</p>
{/* Newsletter */}
<div className="mb-4">
<p className="mb-2 text-sm font-medium">
Subscribe to our newsletter
</p>
<div className="flex gap-2">
<Input
type="email"
placeholder="Enter your email"
className="h-9"
/>
<Button size="sm">
<Mail className="h-4 w-4" />
</Button>
</div>
</div>
{/* Contact Info */}
<div className="space-y-2 text-sm text-muted-foreground">
<motion.div
whileHover={{ x: 5 }}
className="flex items-center gap-2"
>
<MapPin className="h-4 w-4" />
<span>123 Business St, City 12345</span>
</motion.div>
<motion.div
whileHover={{ x: 5 }}
className="flex items-center gap-2"
>
<Phone className="h-4 w-4" />
<span>+1 (555) 123-4567</span>
</motion.div>
<motion.div
whileHover={{ x: 5 }}
className="flex items-center gap-2"
>
<Mail className="h-4 w-4" />
<span>hello@example.com</span>
</motion.div>
</div>
</motion.div>
{/* Footer Links */}
{footerLinks.map((section, sectionIndex) => (
<motion.div
key={section.title}
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5, delay: sectionIndex * 0.1 }}
>
<h4 className="mb-4 text-sm font-semibold">{section.title}</h4>
<ul className="space-y-2">
{section.links.map((link, linkIndex) => (
<motion.li
key={link}
initial={{ opacity: 0, x: -10 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{ delay: linkIndex * 0.05 }}
>
<motion.a
href="#"
whileHover={{ x: 5, color: 'hsl(var(--primary))' }}
className="text-sm text-muted-foreground transition-colors hover:text-foreground"
>
{link}
</motion.a>
</motion.li>
))}
</ul>
</motion.div>
))}
</div>
{/* Divider */}
<motion.div
initial={{ scaleX: 0 }}
whileInView={{ scaleX: 1 }}
viewport={{ once: true }}
transition={{ duration: 0.8, delay: 0.4 }}
className="my-8 h-px bg-border"
/>
{/* Bottom Bar */}
<div className="flex flex-col items-center justify-between gap-4 md:flex-row">
{/* Social Links */}
<motion.div
initial={{ opacity: 0 }}
whileInView={{ opacity: 1 }}
viewport={{ once: true }}
transition={{ delay: 0.5 }}
className="flex gap-2"
>
{socialLinks.map((social, index) => (
<motion.div
key={social.label}
initial={{ scale: 0 }}
whileInView={{ scale: 1 }}
viewport={{ once: true }}
transition={{
type: 'spring',
stiffness: 300,
damping: 20,
delay: 0.6 + index * 0.05,
}}
>
<Button
size="icon"
variant="ghost"
className="h-9 w-9 hover:bg-primary/10 hover:text-primary"
aria-label={social.label}
>
<motion.div
whileHover={{ rotate: 360, scale: 1.2 }}
transition={{ duration: 0.3 }}
>
<social.icon className="h-4 w-4" />
</motion.div>
</Button>
</motion.div>
))}
</motion.div>
{/* Copyright */}
<motion.div
initial={{ opacity: 0 }}
whileInView={{ opacity: 1 }}
viewport={{ once: true }}
transition={{ delay: 0.6 }}
className="flex items-center gap-2 text-sm text-muted-foreground"
>
<span>© 2024 Brand. All rights reserved.</span>
<Badge variant="outline" className="text-xs">
v1.0.0
</Badge>
</motion.div>
{/* Scroll to Top */}
<motion.div
initial={{ opacity: 0 }}
whileInView={{ opacity: 1 }}
viewport={{ once: true }}
transition={{ delay: 0.7 }}
>
<Button
size="icon"
variant="outline"
className="h-9 w-9"
onClick={scrollToTop}
>
<motion.div
animate={{ y: [0, -3, 0] }}
transition={{ repeat: Infinity, duration: 1.5 }}
>
<ArrowUp className="h-4 w-4" />
</motion.div>
</Button>
</motion.div>
</div>
</div>
{/* Animated Background Gradient */}
<motion.div
animate={{
background: [
'radial-gradient(circle at 0% 0%, hsl(var(--primary) / 0.05) 0%, transparent 50%)',
'radial-gradient(circle at 100% 100%, hsl(var(--primary) / 0.05) 0%, transparent 50%)',
'radial-gradient(circle at 0% 0%, hsl(var(--primary) / 0.05) 0%, transparent 50%)',
],
}}
transition={{ duration: 10, repeat: Infinity, ease: 'linear' }}
className="pointer-events-none absolute inset-0 -z-10"
/>
</footer>
)
}
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