Features
- ✅ Prominent social icons - Large, eye-catching social buttons
- ✅ Brand colors - Each icon shows brand color on hover
- ✅ Username tooltips - Optional username display on hover
- ✅ Scale animation - Icons scale up on hover
- ✅ Dark mode support - Full dark mode with proper colors
- ✅ 6 social platforms - Twitter, Facebook, Instagram, LinkedIn, GitHub, YouTube
- ✅ Clean layout - Centered, minimal design
- ✅ Grid pattern - Subtle background decoration
- ✅ Responsive - Perfect on all screen sizes
- ✅ TypeScript support - Full type safety
Installation
Copy and paste the following code into your project.
import Link from "next/link";
import {
FaXTwitter,
FaFacebook,
FaInstagram,
FaLinkedin,
FaGithub,
FaYoutube,
} from "react-icons/fa6";
interface FooterLink {
label: string;
href: string;
}
interface SocialLink {
icon: "x" | "facebook" | "instagram" | "linkedin" | "github" | "youtube";
href: string;
label: string;
username?: string;
}
interface FooterSocialProps {
companyName: string;
tagline?: string;
socialLinks: SocialLink[];
links?: FooterLink[];
copyrightText?: string;
}
const socialIcons = {
x: FaXTwitter,
facebook: FaFacebook,
instagram: FaInstagram,
linkedin: FaLinkedin,
github: FaGithub,
youtube: FaYoutube,
};
const socialColors = {
x: "hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black",
facebook: "hover:bg-blue-600 hover:text-white",
instagram: "hover:bg-pink-600 hover:text-white",
linkedin: "hover:bg-blue-700 hover:text-white",
github:
"hover:bg-gray-900 hover:text-white dark:hover:bg-white dark:hover:text-gray-900",
youtube: "hover:bg-red-600 hover:text-white",
};
export function FooterSocial({
companyName,
tagline,
socialLinks,
links,
copyrightText,
}: FooterSocialProps) {
return (
<footer className="relative w-full overflow-hidden border-t border-gray-200 bg-white py-12 dark:border-gray-800 dark:bg-gray-950 sm:py-16 rounded">
<div className="absolute inset-0 bg-[linear-gradient(to_right,#8080800a_1px,transparent_1px),linear-gradient(to_bottom,#8080800a_1px,transparent_1px)] bg-[size:24px_24px]" />
<div className="container relative mx-auto w-full px-6">
<div className="mx-auto max-w-7xl">
<div className="grid gap-12 lg:grid-cols-2 lg:gap-16">
<div className="flex flex-col justify-center">
<Link href="/" className="group inline-block">
<span className="text-2xl font-bold text-gray-900 transition-colors dark:text-white sm:text-3xl">
{companyName}
</span>
</Link>
{tagline && (
<p className="mt-3 text-sm text-gray-600 dark:text-gray-400 sm:text-base">
{tagline}
</p>
)}
{links && links.length > 0 && (
<nav className="mt-6 flex flex-wrap items-center gap-x-6 gap-y-2">
{links.map((link, index) => (
<Link
key={index}
href={link.href}
className="text-sm font-medium text-gray-600 transition-colors hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
>
{link.label}
</Link>
))}
</nav>
)}
</div>
<div className="flex items-center justify-center lg:justify-end">
<div className="flex flex-wrap items-center justify-center gap-3 sm:gap-4">
{socialLinks.map((social, index) => {
const Icon = socialIcons[social.icon];
const colorClass = socialColors[social.icon];
return (
<Link
key={index}
href={social.href}
aria-label={social.label}
className={`group relative flex h-12 w-12 items-center justify-center rounded-xl border-2 border-gray-200 bg-white text-gray-700 shadow-lg transition-all hover:scale-110 hover:border-transparent hover:shadow-xl dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300 sm:h-14 sm:w-14 ${colorClass}`}
>
<Icon className="h-5 w-5 sm:h-6 sm:w-6" />
{social.username && (
<span className="absolute -bottom-6 left-1/2 -translate-x-1/2 whitespace-nowrap text-xs font-medium text-gray-500 opacity-0 transition-opacity group-hover:opacity-100 dark:text-gray-400">
@{social.username}
</span>
)}
</Link>
);
})}
</div>
</div>
</div>
<div className="mt-10 border-t border-gray-200 pt-6 dark:border-gray-800 sm:mt-12 sm:pt-8">
<p className="text-sm text-gray-500 dark:text-gray-500">
{copyrightText ||
`© ${new Date().getFullYear()} ${companyName}. All rights reserved.`}
</p>
</div>
</div>
</div>
</footer>
);
}Install the required dependencies.
npm install react-iconsUsage
Basic Usage
import FooterSocial from "@/components/ui/footer-social";
export default function Layout({ children }) {
return (
<>
{children}
<FooterSocial
companyName="Acme Inc"
tagline="Building amazing products"
socialLinks={[
{ icon: "x", href: "https://x.com/acme", label: "X (Twitter)" },
{ icon: "github", href: "https://github.com/acme", label: "GitHub" },
]}
/>
</>
);
}With Usernames
<FooterSocial
companyName="Acme Inc"
socialLinks={[
{
icon: "x",
href: "https://x.com/acme",
label: "X (Twitter)",
username: "acme",
},
{
icon: "instagram",
href: "https://instagram.com/acme",
label: "Instagram",
username: "acme",
},
]}
/>With Links
<FooterSocial
companyName="Acme Inc"
tagline="Building the future"
socialLinks={[...]}
links={[
{ label: "About", href: "/about" },
{ label: "Blog", href: "/blog" },
{ label: "Contact", href: "/contact" },
{ label: "Privacy", href: "/privacy" },
]}
/>All Social Platforms
<FooterSocial
companyName="Acme Inc"
socialLinks={[
{ icon: "x", href: "#", label: "X (Twitter)", username: "acme" },
{ icon: "facebook", href: "#", label: "Facebook" },
{ icon: "instagram", href: "#", label: "Instagram", username: "acme" },
{ icon: "linkedin", href: "#", label: "LinkedIn" },
{ icon: "github", href: "#", label: "GitHub", username: "acme" },
{ icon: "youtube", href: "#", label: "YouTube", username: "acme" },
]}
/>Minimal Version
<FooterSocial
companyName="Acme Inc"
socialLinks={[
{ icon: "x", href: "#", label: "X (Twitter)" },
{ icon: "github", href: "#", label: "GitHub" },
]}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
companyName | string | Required | Company name |
tagline | string | undefined | Company tagline or description |
socialLinks | SocialLink[] | Required | Social media links |
links | FooterLink[] | undefined | Additional footer links |
copyrightText | string | Auto-generated | Custom copyright text |
TypeScript Interface
interface FooterSocialProps {
companyName: string;
tagline?: string;
socialLinks: SocialLink[];
links?: FooterLink[];
copyrightText?: string;
}
interface SocialLink {
icon: "x" | "facebook" | "instagram" | "linkedin" | "github" | "youtube";
href: string;
label: string;
username?: string;
}
interface FooterLink {
label: string;
href: string;
}Use Cases
Perfect for:
- Personal brands
- Creator websites
- Portfolio sites
- Agency websites
- Community platforms
- Content creators
- Influencer sites
- Social-first businesses