Landing Page
Learn how to create beautiful, responsive landing pages using the built-in block components
TanStarter includes pre-built block components that let you quickly create responsive landing pages.
Available Block Components
The TanStarter template includes the following block components in src/components/blocks/:
| Component | File | Description |
|---|---|---|
| Hero | hero.tsx | Engaging, attention-grabbing page header |
| Logo Cloud | logo-cloud.tsx | Display partner or client logos |
| Stats | stats.tsx | Display important metrics and statistics |
| Features | features.tsx | Highlight your product's key capabilities |
| Features 2 | features2.tsx | Alternative feature display layout |
| Features 3 | features3.tsx | Another feature display variant |
| Call to Action | calltoaction.tsx | Encourage user actions |
| Integration | integration.tsx | Showcase third-party integrations |
| Integration 2 | integration2.tsx | Alternative integration display |
| Pricing | pricing.tsx | Showcase your pricing plans |
| FAQ | faqs.tsx | Answer common questions |
| Testimonials | testimonials.tsx | Display customer reviews |
| Newsletter | newsletter-card.tsx | Email subscription form |
Landing Page Structure
The landing page is assembled in src/components/blocks/homepage.tsx, which imports and composes all block components:
import HeroSection from '@/components/blocks/hero';
import LogoCloudSection from '@/components/blocks/logo-cloud';
import StatsSection from '@/components/blocks/stats';
import Features3Section from '@/components/blocks/features3';
import FeaturesSection from '@/components/blocks/features';
import CallToActionSection from '@/components/blocks/calltoaction';
import Features2Section from '@/components/blocks/features2';
import IntegrationSection from '@/components/blocks/integration';
import Integration2Section from '@/components/blocks/integration2';
import PricingSection from '@/components/blocks/pricing';
import FaqSection from '@/components/blocks/faqs';
import TestimonialsSection from '@/components/blocks/testimonials';
import NewsletterCard from '@/components/blocks/newsletter-card';
export function HomePage() {
return (
<div className="flex flex-col">
<HeroSection />
<LogoCloudSection />
<StatsSection />
<Features3Section />
<FeaturesSection />
<CallToActionSection />
<Features2Section />
<IntegrationSection />
<Integration2Section />
<PricingSection />
<FaqSection />
<TestimonialsSection />
<NewsletterCard />
</div>
);
}Customizing the Landing Page
Rearranging Sections
To change the order of sections or remove/add sections, simply edit homepage.tsx:
export function HomePage() {
return (
<div className="flex flex-col">
<HeroSection />
<FeaturesSection />
<PricingSection />
<TestimonialsSection />
{/* Remove or add sections as needed */}
</div>
);
}Customizing Individual Blocks
Each block component is a self-contained file in src/components/blocks/. To customize a block:
- Open the corresponding file (e.g.,
hero.tsx) - Modify the content, styling, or layout directly
- Text content is sourced from the
messagesmodule for easy localization
Creating New Block Components
To create a new block component:
- Create a new file in
src/components/blocks/(e.g.,my-section.tsx) - Implement your component:
import { messages } from '@/messages';
export default function MySection() {
return (
<section className="py-16 md:py-24">
<div className="container mx-auto px-4">
<h2 className="text-3xl font-bold text-center">
{messages.home.mySection.title}
</h2>
<p className="mt-4 text-center text-muted-foreground">
{messages.home.mySection.description}
</p>
</div>
</section>
);
}- Add the component to
homepage.tsx:
import MySection from '@/components/blocks/my-section';
export function HomePage() {
return (
<div className="flex flex-col">
<HeroSection />
<MySection />
{/* ... other sections */}
</div>
);
}Best Practices
When creating your landing page, consider these best practices:
- Focus on user flow: Arrange blocks to guide users through a logical journey
- Maintain consistency: Use consistent colors, fonts, and styling throughout
- Optimize for performance: Compress images and minimize unnecessary animations
- Mobile first: Ensure your landing page looks great on all devices
- Test loading times: Verify that your page loads quickly, especially the above-the-fold content
- Clear call-to-action: Make your primary CTA prominent and compelling
Next Steps
Now that you understand how to create and customize landing pages in TanStarter, explore these related topics:
TanStarter Docs