Navigations-Komponenten
Eine Navigationsleiste im Dunkelmodus mit responsivem Design mit Logo, Avatar und Links für die Navigation.
HTML-Code
<nav class="bg-gray-900 text-white p-4 flex justify-between items-center">
<div class="flex items-center space-x-4">
<img src="https://picsum.photos/50/50" alt="Logo" class="w-10 h-10 rounded-full">
<span class="text-xl font-semibold">My Website</span>
</div>
<div class="hidden md:flex space-x-4">
<a href="#" class="hover:text-gray-400 transition duration-200">Home</a>
<a href="#" class="hover:text-gray-400 transition duration-200">About</a>
<a href="#" class="hover:text-gray-400 transition duration-200">Services</a>
<a href="#" class="hover:text-gray-400 transition duration-200">Contact</a>
</div>
<div class="relative">
<img src="https://randomuser.me/api/portraits/men/1.jpg" alt="User Avatar" class="w-10 h-10 rounded-full cursor-pointer">
<div class="absolute right-0 mt-2 w-48 bg-gray-800 text-white rounded-md shadow-lg hidden group-hover:block">
<a href="#" class="block px-4 py-2 hover:bg-gray-700">Profile</a>
<a href="#" class="block px-4 py-2 hover:bg-gray-700">Settings</a>
<a href="#" class="block px-4 py-2 hover:bg-gray-700">Logout</a>
</div>
</div>
</nav>
<style>
@media (prefers-color-scheme: dark) {
body {
background-color: #1a1a1a;
}
}
</style>
Verwandte Komponenten
Komponente "Navigationskomponenten"
Eine reaktionsschnelle Navigationskomponente mit lebendigen Farben und Mikrointeraktionen, die für ein Portfolio entwickelt wurde.
Retro Social Media Navigation
Responsive Navigationskomponente mit Dark Mode für Social Media (Retro/Vintage, Erdtöne, moderate Komplexität)
JobBoardNavigation
Eine einfache, reaktionsschnelle Navigationskomponente für eine Jobbörse oder eine Karriereentwicklungsplattform mit Ozean-/Blautönen, Mikrointeraktionen beim Schweben und Unterstützung des Dunkelmodus.