<nav class="bg-white shadow-lg">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<!-- Logo -->
<div class="flex items-center">
<a href="/" class="text-2xl font-bold text-blue-600">Logo</a>
</div>
<!-- Desktop Menu -->
<div class="hidden md:flex items-center space-x-8">
<a href="#" class="text-gray-700 hover:text-blue-600 transition">Home</a>
<a href="#" class="text-gray-700 hover:text-blue-600 transition">About</a>
<a href="#" class="text-gray-700 hover:text-blue-600 transition">Services</a>
<a href="#" class="text-gray-700 hover:text-blue-600 transition">Contact</a>
<button class="bg-blue-600 text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition">
Get Started
</button>
</div>
<!-- Mobile Menu Button -->
<div class="md:hidden flex items-center">
<button class="text-gray-700 hover:text-blue-600">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
</button>
</div>
</div>
</div>
<!-- Mobile Menu -->
<div class="md:hidden">
<div class="px-2 pt-2 pb-3 space-y-1">
<a href="#" class="block px-3 py-2 text-gray-700 hover:bg-blue-50 rounded-md">Home</a>
<a href="#" class="block px-3 py-2 text-gray-700 hover:bg-blue-50 rounded-md">About</a>
<a href="#" class="block px-3 py-2 text-gray-700 hover:bg-blue-50 rounded-md">Services</a>
<a href="#" class="block px-3 py-2 text-gray-700 hover:bg-blue-50 rounded-md">Contact</a>
<button class="w-full text-left px-3 py-2 bg-blue-600 text-white rounded-md">
Get Started
</button>
</div>
</div>
</nav>
export default function Navbar() {
const [isOpen, setIsOpen] = useState(false);
return (
<nav className="bg-white shadow-lg">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex justify-between h-16">
{/* Logo */}
<div className="flex items-center">
<a href="/" className="text-2xl font-bold text-blue-600">Logo</a>
</div>
{/* Desktop Menu */}
<div className="hidden md:flex items-center space-x-8">
<a href="#" className="text-gray-700 hover:text-blue-600 transition">Home</a>
<a href="#" className="text-gray-700 hover:text-blue-600 transition">About</a>
<a href="#" className="text-gray-700 hover:text-blue-600 transition">Services</a>
<a href="#" className="text-gray-700 hover:text-blue-600 transition">Contact</a>
<button className="bg-blue-600 text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition">
Get Started
</button>
</div>
{/* Mobile Menu Button */}
<div className="md:hidden flex items-center">
<button onClick={() => setIsOpen(!isOpen)} className="text-gray-700 hover:text-blue-600">
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16M4 18h16" />
</svg>
</button>
</div>
</div>
</div>
{/* Mobile Menu */}
{isOpen && (
<div className="md:hidden">
<div className="px-2 pt-2 pb-3 space-y-1">
<a href="#" className="block px-3 py-2 text-gray-700 hover:bg-blue-50 rounded-md">Home</a>
<a href="#" className="block px-3 py-2 text-gray-700 hover:bg-blue-50 rounded-md">About</a>
<a href="#" className="block px-3 py-2 text-gray-700 hover:bg-blue-50 rounded-md">Services</a>
<a href="#" className="block px-3 py-2 text-gray-700 hover:bg-blue-50 rounded-md">Contact</a>
<button className="w-full text-left px-3 py-2 bg-blue-600 text-white rounded-md">
Get Started
</button>
</div>
</div>
)}
</nav>
);
}
<template>
<nav class="bg-white shadow-lg">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<!-- Logo -->
<div class="flex items-center">
<a href="/" class="text-2xl font-bold text-blue-600">Logo</a>
</div>
<!-- Desktop Menu -->
<div class="hidden md:flex items-center space-x-8">
<a href="#" class="text-gray-700 hover:text-blue-600 transition">Home</a>
<a href="#" class="text-gray-700 hover:text-blue-600 transition">About</a>
<a href="#" class="text-gray-700 hover:text-blue-600 transition">Services</a>
<a href="#" class="text-gray-700 hover:text-blue-600 transition">Contact</a>
<button class="bg-blue-600 text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition">
Get Started
</button>
</div>
<!-- Mobile Menu Button -->
<div class="md:hidden flex items-center">
<button @click="isOpen = !isOpen" class="text-gray-700 hover:text-blue-600">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
</button>
</div>
</div>
</div>
<!-- Mobile Menu -->
<div v-if="isOpen" class="md:hidden">
<div class="px-2 pt-2 pb-3 space-y-1">
<a href="#" class="block px-3 py-2 text-gray-700 hover:bg-blue-50 rounded-md">Home</a>
<a href="#" class="block px-3 py-2 text-gray-700 hover:bg-blue-50 rounded-md">About</a>
<a href="#" class="block px-3 py-2 text-gray-700 hover:bg-blue-50 rounded-md">Services</a>
<a href="#" class="block px-3 py-2 text-gray-700 hover:bg-blue-50 rounded-md">Contact</a>
<button class="w-full text-left px-3 py-2 bg-blue-600 text-white rounded-md">
Get Started
</button>
</div>
</div>
</nav>
</template>
<script setup>
import { ref } from 'vue';
const isOpen = ref(false);
</script>