Component
Centered Navbar
Logo-centered navigation with symmetrical link groups on both sides. Ideal for brand-focused marketing sites.
- Component
- Tailwind
- HTML
- MIT
Preview
Live component
9:41 100%
devsnips.dev/library/tailwind/components/navigation/centered-navbar/ fluid · no fixed width 100%
Install
Add to your project
npx devsnips add Tailwind/Components/Navigation/centered-navbar Tailwind/Components/Navigation/centered-navbar <nav class="bg-white border-b border-gray-100">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-center justify-between h-20">
<!-- Left Navigation -->
<div class="hidden lg:flex items-center space-x-6">
<a href="#" class="text-gray-600 hover:text-indigo-600 transition-colors font-medium">Features</a>
<a href="#" class="text-gray-600 hover:text-indigo-600 transition-colors font-medium">Solutions</a>
<a href="#" class="text-gray-600 hover:text-indigo-600 transition-colors font-medium">Pricing</a>
</div>
<!-- Centered Logo -->
<div class="flex-shrink-0 absolute left-1/2 transform -translate-x-1/2">
<a href="#" class="flex items-center gap-3">
<div class="w-10 h-10 bg-gradient-to-br from-indigo-600 to-purple-600 rounded-xl flex items-center justify-center shadow-lg shadow-indigo-500/30">
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"/>
</svg>
</div>
<span class="text-2xl font-bold bg-gradient-to-r from-gray-900 to-gray-700 bg-clip-text text-transparent">Prism</span>
</a>
</div>
<!-- Right Navigation -->
<div class="hidden lg:flex items-center space-x-6">
<a href="#" class="text-gray-600 hover:text-indigo-600 transition-colors font-medium">Resources</a>
<a href="#" class="text-gray-600 hover:text-indigo-600 transition-colors font-medium">Enterprise</a>
<a href="#" class="text-gray-600 hover:text-indigo-600 transition-colors font-medium">Contact</a>
</div>
<!-- Mobile Menu Button -->
<div class="lg:hidden">
<button type="button" class="text-gray-600 hover:text-gray-900 focus:outline-none p-2" aria-label="Menu">
<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"/>
</svg>
</button>
</div>
<!-- CTA Button -->
<div class="hidden lg:flex items-center gap-4">
<a href="#" class="text-gray-600 hover:text-indigo-600 transition-colors font-medium">Sign In</a>
<a href="#" class="px-5 py-2.5 bg-gray-900 text-white text-sm font-semibold rounded-full hover:bg-gray-800 transition-colors shadow-lg shadow-gray-900/20">
Get Started
</a>
</div>
</div>
</div>
<!-- Mobile Menu -->
<div class="lg:hidden hidden border-t border-gray-100" id="mobile-menu">
<div class="px-4 py-6 space-y-4">
<a href="#" class="block text-gray-600 hover:text-indigo-600 font-medium">Features</a>
<a href="#" class="block text-gray-600 hover:text-indigo-600 font-medium">Solutions</a>
<a href="#" class="block text-gray-600 hover:text-indigo-600 font-medium">Pricing</a>
<a href="#" class="block text-gray-600 hover:text-indigo-600 font-medium">Resources</a>
<a href="#" class="block text-gray-600 hover:text-indigo-600 font-medium">Enterprise</a>
<a href="#" class="block text-gray-600 hover:text-indigo-600 font-medium">Contact</a>
<div class="pt-4 border-t border-gray-100 flex flex-col gap-3">
<a href="#" class="text-center py-2.5 text-gray-600 font-medium border border-gray-300 rounded-full">Sign In</a>
<a href="#" class="text-center py-2.5 bg-gray-900 text-white font-semibold rounded-full">Get Started</a>
</div>
</div>
</div>
</nav> # Centered Navbar
Centered logo/link navbar.
## Usage
```bash
npx devsnips add Tailwind/Components/Navigation/centered-navbar
```
Copy from `code.html`.
## File Structure
`code.html` · `preview.html` · `metadata.json` · `README.md` 64 lines UTF-8 · LF · Spaces: 2
Continue browsing