React Tailwind CSS Landing Page: Space Tourism Destination Guide
Ever wondered how to create those beautiful, modern landing pages you see for space companies like SpaceX? In this comprehensive tutorial, I'll walk you through building a captivating space tourism destination page using React and Tailwind CSS, complete with a responsive navigation bar and smooth animations.
What We're Building
Our space tourism landing page will feature:
Responsive mobile hamburger navigation with backdrop blur effects
Hero section with stunning space imagery
Interactive destination selector with tab navigation
Detailed destination information with statistics
Modern glassmorphism design using Tailwind CSS
Fully responsive layout for all devices
YouTube Video:
Project Setup
Before we start, make sure you have a React project set up with Tailwind CSS. You'll also need these custom fonts in your tailwind.config.js
:
module.exports = {
theme: {
extend: {
fontFamily: {
'Barlow': ['Barlow', 'sans-serif'],
'Bellefair': ['Bellefair', 'serif'],
},
backgroundImage: {
'hero-bg': "url('./src/assets/background-destination-desktop.jpg')",
}
}
}
}
Required Assets
You'll need these images in your src/assets/
folder:
background-destination-desktop.jpg
- Hero backgroundlogo.svg
- Space company logoicon-hamburger.svg
- Mobile menu iconicon-close.svg
- Close menu iconimage-moon.png
- Moon destination image
Step 1: Building the Navigation Component
Let's start with creating a sophisticated navigation bar that transforms into a mobile hamburger menu:
import { useState } from "react"
const Nav = () => {
let [open, setopen] = useState(false)
const menus = [
{ name: "HOME" },
{ name: "DESTINATION" },
{ name: "CREW" },
{ name: "TECHNOLOGY" },
]
return (
<nav className="flex items-center justify-between pt-5">
{/* Mobile Menu Toggle */}
<img
src={open ? "./src/assets/icon-close.svg" : "./src/assets/icon-hamburger.svg"}
className="md:hidden fixed right-5 cursor-pointer z-20 top-6"
onClick={() => setopen(!open)}
/>
{/* Logo */}
<img src="./src/assets/logo.svg" alt="logo" className="w-10 ml-7" />
{/* Navigation Menu */}
<ul className={`bg-[#ffffff14] backdrop-blur-md md:pl-10 pr-28 md:static fixed duration-500 ease-linear top-0 md:h-auto h-screen z-10 ${!open ? 'right-[-100%]' : 'right-0'}`}>
{menus.map((menu, index) => (
<li key={index} className="md:inline-block md:ml-10 ml-5 md:my-0 my-6 border-b-2 border-transparent hover:border-white duration-300">
<a className="text-white cursor-pointer font-Barlow font-normal text-sm inline-block md:py-5 py-3">
<span className="font-bold mr-1.5">0{index}</span>{menu.name}
</a>
</li>
))}
</ul>
</nav>
)
}
export default Nav
Key Navigation Features:
1. State Management:
let [open, setopen] = useState(false)
We track whether the mobile menu is open or closed.
2. Dynamic Icon Toggle:
src={open ? "./src/assets/icon-close.svg" : "./src/assets/icon-hamburger.svg"}
The menu icon changes based on the open state.
3. Sliding Mobile Menu:
${!open ? 'right-[-100%]' : 'right-0'}
The mobile menu slides in from the right with smooth CSS transitions.
4. Glassmorphism Effect:
bg-[#ffffff14] backdrop-blur-md
Creates that modern frosted glass appearance.
Step 2: Creating the Main Landing Page
Now let's build the main destination page component:
import Nav from "./components/Nav"
function App() {
return (
<section className="bg-hero-bg md:h-screen bg-cover bg-center font-Barlow pb-2">
<Nav />
<div className="md:container px-2 pt-5 md:text-left text-center">
{/* Page Header */}
<h1 className="text-2xl text-white">
<span className="text-[#ffffff70] font-bold mr-2">01</span>
PICK YOUR DESTINATION
</h1>
<div className="md:flex items-center md:justify-between pt-6">
{/* Destination Image */}
<img
src="./src/assets/image-moon.png"
className="md:w-[36%] w-[52%] md:mx-0 mx-auto md:py-0 py-4"
/>
{/* Destination Information */}
<div className="md:w-1/2">
{/* Destination Tabs */}
<ul className="text-white pb-4">
<li className="inline-block cursor-pointer md:mr-8 md:mx-0 mx-4 md:ml-2 border-b-2">MOON</li>
<li className="inline-block cursor-pointer md:mr-8 md:mx-0 mx-4">MARS</li>
<li className="inline-block cursor-pointer md:mr-8 md:mx-0 mx-4">EUROPA</li>
<li className="inline-block cursor-pointer md:mr-8 md:mx-0 mx-4">TITAN</li>
</ul>
{/* Destination Title */}
<h1 className="text-white w-full font-Bellefair pb-2 text-7xl">MOON</h1>
{/* Destination Description */}
<p className="text-[#d2d8f9] font-extralight text-sm md:w-2/3 md:pl-1 leading-6 tracking-wide pb-10 border-b-[0.5px] border-[#ffffff66]">
See our planet as you've never seen it before. A perfect relaxing trip away to help regain perspective and come back refreshed. While you're there, take in some history by visiting the Luna 2 and Apollo 11 landing sites.
</p>
{/* Travel Statistics */}
<div className="flex md:justify-between justify-around lg:w-1/2 w-auto pt-10">
<div>
<span className="text-[#d2d8f9] text-sm">Avg. distance</span>
<h1 className="text-white text-xl">384,400 KM</h1>
</div>
<div>
<span className="text-[#d2d8f9] text-sm">Est. travel time</span>
<h1 className="text-white text-xl">3 DAYS</h1>
</div>
</div>
</div>
</div>
</div>
</section>
)
}
export default App
Step 3: Understanding the Design System
Color Palette
Our space theme uses a sophisticated color system:
/* Primary Colors */
--white: #ffffff
--light-blue: #d2d8f9
--transparent-white: #ffffff70
--border-color: #ffffff66
--glass-bg: #ffffff14
Typography Hierarchy
// Page numbers and labels
className="text-[#ffffff70] font-bold"
// Main headings
className="text-white font-Bellefair text-7xl"
// Body text
className="text-[#d2d8f9] font-extralight text-sm"
// Navigation
className="text-white font-Barlow font-normal text-sm"
Responsive Breakpoints
The design adapts beautifully across devices:
// Mobile-first approach
className="w-[52%] mx-auto py-4"
// Desktop enhancements
className="md:w-[36%] md:mx-0 md:py-0"
Step 4: Advanced Features and Animations
Smooth Transitions
// Navigation hover effects
className="border-b-2 border-transparent hover:border-white duration-300"
// Mobile menu slide animation
className="duration-500 ease-linear"
Backdrop Blur Effect
// Modern glassmorphism
className="bg-[#ffffff14] backdrop-blur-md"
Fixed Positioning
// Mobile menu toggle stays in place
className="fixed right-5 top-6 z-20"
// Full-screen mobile menu
className="fixed top-0 h-screen z-10"
Step 5: Making It Interactive
To make this even more dynamic, you could add state management for destination switching:
const [activeDestination, setActiveDestination] = useState('MOON')
const destinations = {
MOON: {
image: './src/assets/image-moon.png',
title: 'MOON',
description: 'See our planet as you\'ve never seen it before...',
distance: '384,400 KM',
travelTime: '3 DAYS'
},
MARS: {
image: './src/assets/image-mars.png',
title: 'MARS',
description: 'Don\'t forget to pack your hiking boots...',
distance: '225 MIL. KM',
travelTime: '9 MONTHS'
}
// ... more destinations
}
Step 6: Complete Project Structure
src/
├── components/
│ └── Nav.jsx
├── assets/
│ ├── background-destination-desktop.jpg
│ ├── logo.svg
│ ├── icon-hamburger.svg
│ ├── icon-close.svg
│ └── image-moon.png
├── App.jsx
└── index.css
Optimization Tips
1. Image Optimization
// Add loading optimization
<img loading="lazy" alt="Moon destination" />
2. Accessibility Improvements
// Add proper ARIA labels
<button aria-label="Toggle navigation menu" />
<nav aria-label="Main navigation" />
3. Performance Enhancements
// Lazy load components
const Nav = lazy(() => import('./components/Nav'))
Mobile Responsiveness Deep Dive
The design gracefully handles different screen sizes:
Mobile (< 768px):
Hamburger menu with full-screen overlay
Centered content layout
Stacked information sections
Touch-friendly button sizes
Desktop (≥ 768px):
Horizontal navigation bar
Side-by-side layout
Larger typography
Hover effects
Deployment Considerations
When deploying this project:
Optimize images - Compress your background and destination images
Set up proper routing - If expanding to multiple pages
Configure build settings - Ensure Tailwind purges unused CSS
Test across devices - Verify responsive behavior
Next Steps and Enhancements
Consider adding these features to enhance the user experience:
1. Destination Data Management:
// Create a destinations data file
export const destinations = [
{ id: 'moon', name: 'MOON', ... },
{ id: 'mars', name: 'MARS', ... }
]
2. Smooth Scrolling:
// Add smooth transitions between sections
const scrollToDestination = () => {
document.getElementById('destination').scrollIntoView({
behavior: 'smooth'
})
}
3. Loading States:
const [loading, setLoading] = useState(true)
// Add skeleton loading for images
4. Animation Library Integration:
// Consider adding Framer Motion for advanced animations
import { motion } from 'framer-motion'
Complete Code Files
App.jsx (Main Component)
import Nav from "./components/Nav"
function App() {
return (
<section className="bg-hero-bg md:h-screen bg-cover bg-center font-Barlow pb-2">
<Nav />
<div className="md:container px-2 pt-5 md:text-left text-center">
<h1 className="text-2xl text-white">
<span className="text-[#ffffff70] font-bold mr-2">01</span>
PICK YOUR DESTINATION
</h1>
<div className="md:flex items-center md:justify-between pt-6">
<img
src="./src/assets/image-moon.png"
className="md:w-[36%] w-[52%] md:mx-0 mx-auto md:py-0 py-4"
/>
<div className="md:w-1/2">
<ul className="text-white pb-4">
<li className="inline-block cursor-pointer md:mr-8 md:mx-0 mx-4 md:ml-2 border-b-2">MOON</li>
<li className="inline-block cursor-pointer md:mr-8 md:mx-0 mx-4">MARS</li>
<li className="inline-block cursor-pointer md:mr-8 md:mx-0 mx-4">EUROPA</li>
<li className="inline-block cursor-pointer md:mr-8 md:mx-0 mx-4">TITAN</li>
</ul>
<h1 className="text-white w-full font-Bellefair pb-2 text-7xl">MOON</h1>
<p className="text-[#d2d8f9] font-extralight text-sm md:w-2/3 md:pl-1 leading-6 tracking-wide pb-10 border-b-[0.5px] border-[#ffffff66]">
See our planet as you've never seen it before. A perfect relaxing trip away to help regain perspective and come back refreshed. While you're there, take in some history by visiting the Luna 2 and Apollo 11 landing sites.
</p>
<div className="flex md:justify-between justify-around lg:w-1/2 w-auto pt-10">
<div>
<span className="text-[#d2d8f9] text-sm">Avg. distance</span>
<h1 className="text-white text-xl">384,400 KM</h1>
</div>
<div>
<span className="text-[#d2d8f9] text-sm">Est. travel time</span>
<h1 className="text-white text-xl">3 DAYS</h1>
</div>
</div>
</div>
</div>
</div>
</section>
)
}
export default App
components/Nav.jsx
import { useState } from "react"
const Nav = () => {
let [open, setopen] = useState(false)
const menus = [
{ name: "HOME" },
{ name: "DESTINATION" },
{ name: "CREW" },
{ name: "TECHNOLOGY" },
]
return (
<nav className="flex items-center justify-between pt-5">
<img
src={open ? "./src/assets/icon-close.svg" : "./src/assets/icon-hamburger.svg"}
className="md:hidden fixed right-5 cursor-pointer z-20 top-6"
onClick={() => setopen(!open)}
/>
<img src="./src/assets/logo.svg" alt="logo" className="w-10 ml-7" />
<ul className={`bg-[#ffffff14] backdrop-blur-md md:pl-10 pr-28 md:static fixed duration-500 ease-linear top-0 md:h-auto h-screen z-10 ${!open ? 'right-[-100%]' : 'right-0'}`}>
{menus.map((menu, index) => (
<li key={index} className="md:inline-block md:ml-10 ml-5 md:my-0 my-6 border-b-2 border-transparent hover:border-white duration-300">
<a className="text-white cursor-pointer font-Barlow font-normal text-sm inline-block md:py-5 py-3">
<span className="font-bold mr-1.5">0{index}</span>{menu.name}
</a>
</li>
))}
</ul>
</nav>
)
}
export default Nav
Conclusion
You've successfully built a professional-grade space tourism landing page that showcases modern web development practices. This project demonstrates:
Advanced Tailwind CSS techniques including custom colors, glassmorphism, and responsive design
React state management for interactive components
Mobile-first responsive design principles
Modern UI/UX patterns like backdrop blur and smooth animations
The combination of stunning visuals, smooth interactions, and clean code makes this landing page ready for any space tourism company—or any business wanting to make a stellar first impression!