Component

Sticky Navbar

Sticky navigation with backdrop blur that stays visible while scrolling. Includes integrated search bar and healthcare-themed design.

  • Component
  • Tailwind
  • HTML
  • MIT

Preview

Live component

Interactive preview
Open preview
9:41 100%
devsnips.dev/library/tailwind/components/navigation/sticky-navbar/
fluid · no fixed width 100%
No dependencies Production-ready

Install

Add to your project

terminal
npx devsnips add Tailwind/Components/Navigation/sticky-navbar
registry path: Tailwind/Components/Navigation/sticky-navbar

Source

Implementation

code.html
<nav class="sticky top-0 z-50 bg-white/80 backdrop-blur-xl border-b border-gray-200/50">
  <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
    <div class="flex items-center justify-between h-16">
      <!-- Logo -->
      <a href="#" class="flex items-center gap-3">
        <div class="w-9 h-9 bg-gradient-to-br from-rose-500 to-pink-600 rounded-lg flex items-center justify-center shadow-lg shadow-rose-500/30">
          <svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"/>
          </svg>
        </div>
        <span class="text-gray-900 text-xl font-bold">Heartify</span>
      </a>

      <!-- Search Bar -->
      <div class="hidden md:flex flex-1 max-w-md mx-8">
        <div class="relative w-full">
          <svg class="absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
          </svg>
          <input type="text" placeholder="Search..." class="w-full pl-10 pr-4 py-2 bg-gray-100 border border-transparent rounded-full text-sm focus:outline-none focus:border-rose-300 focus:bg-white transition-colors">
        </div>
      </div>

      <!-- Navigation -->
      <div class="hidden md:flex items-center gap-6">
        <a href="#" class="text-gray-600 hover:text-gray-900 transition-colors font-medium">Home</a>
        <a href="#" class="text-gray-600 hover:text-gray-900 transition-colors">Features</a>
        <a href="#" class="text-gray-600 hover:text-gray-900 transition-colors">Doctors</a>
        <a href="#" class="text-gray-600 hover:text-gray-900 transition-colors">Appointments</a>
      </div>

      <!-- Actions -->
      <div class="flex items-center gap-3">
        <button class="p-2 text-gray-500 hover:text-gray-700 transition-colors" aria-label="Notifications">
          <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"/>
          </svg>
        </button>
        <a href="#" class="hidden sm:inline-flex px-4 py-2 bg-rose-500 text-white text-sm font-semibold rounded-full hover:bg-rose-600 transition-colors shadow-lg shadow-rose-500/30">
          Book Now
        </a>
      </div>

      <!-- Mobile Menu Button -->
      <button class="md:hidden p-2 text-gray-600" 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>
  </div>

  <!-- Mobile Menu -->
  <div class="md:hidden hidden bg-white border-t border-gray-100" id="mobile-menu">
    <div class="px-4 py-4 space-y-3">
      <div class="relative">
        <svg class="absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
          <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
        </svg>
        <input type="text" placeholder="Search..." class="w-full pl-10 pr-4 py-2 bg-gray-100 border border-transparent rounded-full text-sm focus:outline-none focus:border-rose-300">
      </div>
      <a href="#" class="block px-4 py-2 text-gray-900 font-medium rounded-lg hover:bg-gray-50">Home</a>
      <a href="#" class="block px-4 py-2 text-gray-600 rounded-lg hover:bg-gray-50">Features</a>
      <a href="#" class="block px-4 py-2 text-gray-600 rounded-lg hover:bg-gray-50">Doctors</a>
      <a href="#" class="block px-4 py-2 text-gray-600 rounded-lg hover:bg-gray-50">Appointments</a>
      <a href="#" class="block px-4 py-2 bg-rose-500 text-white text-center font-semibold rounded-full">Book Now</a>
    </div>
  </div>
</nav>
69 lines UTF-8 · LF · Spaces: 2

AI-ready

Available to your agent.

This component is reachable through the DevSnips CLI, MCP server and Skills integrations — one registry, one resource path.

Resource path

devsnips://components/navigation/sticky-navbar

Continue browsing

View all