Landing Page Template
A modern landing page template with hero section and features.
Installation
Follow these steps to set up your project with the landing page template:
# Create a new Next.js project
npx create-next-app@latest my-landing-page --typescript --tailwind --app
# Navigate to the project
cd my-landing-page
# Install dependencies
npm install framer-motion @radix-ui/react-dialog @radix-ui/react-separator lucide-reactFile Structure
Create the following files in your project:
components/sections/hero.tsx- Hero section componentcomponents/sections/features.tsx- Features section componentapp/page.tsx- Main page component
Hero Section
Create a new file at components/sections/hero.tsx and add the following code:
import { Button } from "@/components/ui/button";
export function HeroSection() {
return (
<div className="relative">
{/* Background gradient */}
<div className="absolute inset-0 -z-10 mx-0 max-w-none overflow-hidden">
<div className="absolute left-1/2 top-0 ml-[-38rem] h-[25rem] w-[81.25rem] dark:[mask-image:linear-gradient(white,transparent)]">
<div className="absolute inset-0 bg-gradient-to-r from-primary/30 to-secondary/30 [mask-image:radial-gradient(farthest-side_at_top,white,transparent)] dark:from-primary/30 dark:to-secondary/30">
<div className="absolute inset-0 bg-gradient-to-r from-transparent via-primary/10 to-transparent dark:from-transparent dark:via-primary/10 dark:to-transparent"></div>
</div>
</div>
</div>
<div className="container relative">
<div className="mx-auto max-w-3xl py-24 sm:py-32 lg:py-40 text-center">
<h1 className="mb-4 text-4xl font-bold tracking-tight sm:text-5xl">
Build beautiful websites faster
</h1>
<p className="mb-8 text-lg text-muted-foreground">
A collection of modern UI components and templates built with Tailwind CSS and Framer Motion. Fully customizable and ready for production.
</p>
<div className="flex items-center justify-center gap-4">
<Button size="lg">Get Started</Button>
<Button size="lg" variant="outline">
View on GitHub
</Button>
</div>
</div>
</div>
</div>
);
}Features Section
Create a new file at components/sections/features.tsx and add the following code:
import { motion } from "framer-motion";
import { Code, Palette, Zap } from "lucide-react";
const features = [
{
title: "Modern Components",
description:
"Built with modern technologies like React, TypeScript, and Tailwind CSS.",
icon: Code,
},
{
title: "Beautiful Design",
description:
"Carefully crafted components with beautiful animations and interactions.",
icon: Palette,
},
{
title: "Fast Development",
description:
"Get started quickly with pre-built components and templates.",
icon: Zap,
},
];
const container = {
hidden: { opacity: 0 },
show: {
opacity: 1,
transition: {
staggerChildren: 0.2,
},
},
};
const item = {
hidden: { opacity: 0, y: 20 },
show: {
opacity: 1,
y: 0,
transition: {
type: "spring",
},
},
};
export function FeaturesSection() {
return (
<div className="py-24 sm:py-32">
<div className="container">
<div className="text-center mb-16">
<h2 className="mb-4 text-3xl font-bold tracking-tight">Features</h2>
<p className="text-lg text-muted-foreground">
Everything you need to build modern applications.
</p>
</div>
<motion.div
variants={container}
initial="hidden"
whileInView="show"
viewport={{ once: true }}
className="mx-auto grid max-w-5xl grid-cols-1 gap-8 sm:grid-cols-2 lg:grid-cols-3"
>
{features.map((feature) => (
<motion.div
key={feature.title}
variants={item}
className="relative rounded-2xl border bg-background p-8"
>
<div className="mb-6 inline-flex h-12 w-12 items-center justify-center rounded-lg bg-primary/10">
<feature.icon className="h-6 w-6 text-primary" />
</div>
<h3 className="mb-2 text-lg font-semibold">{feature.title}</h3>
<p className="text-muted-foreground">{feature.description}</p>
</motion.div>
))}
</motion.div>
</div>
</div>
);
}Usage
Import and use the sections in your page:
import { HeroSection } from "@/components/sections/hero";
import { FeaturesSection } from "@/components/sections/features";
export default function Home() {
return (
<main>
<HeroSection />
<FeaturesSection />
</main>
);
}Customization
The template is built with customization in mind:
- Modify the content and styling to match your brand
- Add or remove sections as needed
- Customize animations and transitions
- Update the color scheme using Tailwind CSS classes