Sticky Navigation-Komponente
Sticky Navigation Component mit Glassmorphism-Stil, responsiven Effekten und Unterstützung für dunkle Designs mit Tailwind CSS.
HTML-Code
<nav class="sticky top-0 z-10 backdrop-filter backdrop-blur-lg bg-opacity-30 firefox-safari-fix bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700">
<div class="max-w-6xl mx-auto px-4">
<div class="flex justify-between h-16">
<div class="flex">
<div class="flex-shrink-0 flex items-center">
<span class="text-2xl font-bold text-gray-900 dark:text-white">Glassmorphism Nav</span>
</div>
<div class="hidden sm:ml-6 sm:flex sm:space-x-8">
<a href="#" class="border-indigo-500 text-gray-900 dark:text-white inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"> Dashboard </a>
<a href="#" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:text-white inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"> Team </a>
<a href="#" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:text-white inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"> Projects </a>
<a href="#" class="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-300 dark:hover:text-white inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"> Calendar </a>
</div>
</div>
<div class="hidden sm:ml-6 sm:flex sm:items-center">
<button class="bg-gray-100 p-1 rounded-full text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:bg-gray-700 dark:text-gray-300 dark:hover:text-white">
<span class="sr-only">View notifications</span>
<!-- Heroicon name: outline/bell -->
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h2a2 2 0 012 2v2H5v-2a2 2 0 012-2h2m-4 0V5a2 2 0 012-2h4a2 2 0 012 2v12m-4 0h.01m-4 0h.01m-4 0h.01M12 17v2m0-4h.01M8 7h.01M16 7h.01" />
</svg>
</button>
<!-- Profile dropdown -->
<div class="ml-3 relative">
<div>
<button type="button" class="bg-gray-100 flex text-sm rounded-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:bg-gray-700" id="user-menu-button" aria-expanded="false" aria-haspopup="true">
<span class="sr-only">Open user menu</span>
<img class="h-8 w-8 rounded-full" src="https://randomuser.me/api/portraits/men/40.jpg" alt="">
</button>
</div>
</div>
</div>
<div class="-mr-2 flex items-center sm:hidden">
<!-- Mobile menu button -->
<button type="button" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500 dark:hover:bg-gray-700" aria-controls="mobile-menu" aria-expanded="false">
<span class="sr-only">Open main menu</span>
<!-- Icon when menu is closed. -->
<svg class="block h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
</svg>
<!-- Icon when menu is open. -->
<svg class="hidden h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
</div>
</div>
<!-- Mobile menu, show/hide based on menu state. -->
<div class="sm:hidden" id="mobile-menu">
<div class="pt-2 pb-3 space-y-1">
<a href="#" class="border-indigo-500 text-gray-700 block px-3 py-2 border-l-4 text-base font-medium dark:text-white">Dashboard</a>
<a href="#" class="border-transparent text-gray-500 hover:bg-gray-50 hover:border-gray-300 hover:text-gray-700 block px-3 py-2 border-l-4 text-base font-medium dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white">Team</a>
<a href="#" class="border-transparent text-gray-500 hover:bg-gray-50 hover:border-gray-300 hover:text-gray-700 block px-3 py-2 border-l-4 text-base font-medium dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white">Projects</a>
<a href="#" class="border-transparent text-gray-500 hover:bg-gray-50 hover:border-gray-300 hover:text-gray-700 block px-3 py-2 border-l-4 text-base font-medium dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white">Calendar</a>
</div>
<div class="pt-4 pb-3 border-t border-gray-200 dark:border-gray-700">
<div class="flex items-center px-5">
<div class="flex-shrink-0">
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/men/40.jpg" alt="">
</div>
<div class="ml-3">
<div class="text-base font-medium text-gray-800 dark:text-white">Tom Cook</div>
<div class="text-sm font-medium text-gray-500 dark:text-gray-300">[email protected]</div>
</div>
<button type="button" class="ml-auto flex-shrink-0 bg-gray-100 p-1 rounded-full text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:bg-gray-700 dark:text-gray-300 dark:hover:text-white">
<span class="sr-only">View notifications</span>
<!-- Heroicon name: outline/bell -->
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h2a2 2 0 012 2v2H5v-2a2 2 0 012-2h2m-4 0V5a2 2 0 012-2h4a2 2 0 012 2v12m-4 0h.01m-4 0h.01m-4 0h.01M12 17v2m0-4h.01M8 7h.01M16 7h.01" />
</svg>
</button>
</div>
<div class="mt-3 space-y-1">
<a href="#" class="block px-4 py-2 text-base font-medium text-gray-500 hover:text-gray-800 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white">Your Profile</a>
<a href="#" class="block px-4 py-2 text-base font-medium text-gray-500 hover:text-gray-800 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white">Settings</a>
<a href="#" class="block px-4 py-2 text-base font-medium text-gray-500 hover:text-gray-800 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white">Sign out</a>
</div>
</div>
</div>
</nav>
Verwandte Komponenten
Cyberpunk Sticky Navigation
Eine reaktionsschnelle, klebrige Navigationsleiste im Cyberpunk-Stil mit Sonnenuntergangs-/warmen Tönen, die für Finanz-/Bankschnittstellen geeignet ist. Enthält Unterstützung für den Dunkelmodus und interaktive Elemente.
Graustufen-Skeuomorphes Sticky Nav
Eine reaktionsschnelle Sticky-Navigationsleiste für Blogs, die mit Skeuomorphismus unter Verwendung einer Graustufenpalette gestaltet ist. Bietet Unterstützung für den Dunkelmodus und ein einfaches Layout. Erstellt mit Tailwind CSS (nur HTML), kein JavaScript. Das skeuomorphe Design zielt darauf ab, die Navigationsleiste wie ein physisches, leicht erhabenes Element erscheinen zu lassen.
Sticky Navigation-Komponente
Eine reaktionsschnelle, klebrige Navigationsleiste, die mit Mikrointeraktionen und einem triadischen Farbschema gestaltet ist und sich für Blogs und den Konsum von Inhalten eignet.