Dropdown-Menü-Komponente
Eine Dropdown-Menü-Komponente, die im Glassmorphism-Stil gestaltet wurde und reaktionsschnelle Effekte und Unterstützung für dunkle Designs mit Tailwind CSS bietet.
HTML-Code
<div class="relative inline-block text-left">
<div>
<button type="button" class="inline-flex justify-center w-full rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white dark:bg-gray-800 text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-indigo-500" aria-expanded="true" aria-haspopup="true">
Options
<svg class="-mr-1 ml-2 h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M5.23 7.21a.75.75 0 011.06 0L10 10.293l3.71-3.07a.75.75 0 011.07 1.04l-4.5 4.5a.75.75 0 01-1.06 0l-4.5-4.5a.75.75 0 010-1.06z" clip-rule="evenodd" />
</svg>
</button>
</div>
<div class="z-10 hidden origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5 focus:outline-none" role="menu" aria-orientation="vertical" aria-labelledby="options-menu">
<div class="py-1" role="none">
<a href="#" class="flex items-center px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700" role="menuitem">
<img src="https://picsum.photos/30/30" alt="Avatar" class="rounded-full mr-2">
Account Settings
</a>
<a href="#" class="flex items-center px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700" role="menuitem">
<img src="https://picsum.photos/30/30" alt="Avatar" class="rounded-full mr-2">
Support
</a>
<a href="#" class="flex items-center px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700" role="menuitem">
<img src="https://picsum.photos/30/30" alt="Avatar" class="rounded-full mr-2">
License
</a>
<div class="border-t border-gray-200 dark:border-gray-700"></div>
<a href="#" class="flex items-center px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700" role="menuitem">
<img src="https://picsum.photos/30/30" alt="Avatar" class="rounded-full mr-2">
Logout
</a>
</div>
</div>
</div>
<style>
.bg-glass {
background: rgba(255, 255, 255, 0.4);
backdrop-filter: blur(10px);
border-radius: 8px;
}
.dark .bg-glass {
background: rgba(31, 41, 55, 0.4);
}
</style>
Verwandte Komponenten
Dropdown-Menü-Komponente
Eine reaktionsschnelle Dropdown-Menükomponente im Stil von Glassmorphism, geeignet für einen Blog oder den Konsum von Inhalten, mit Unterstützung für dunkle Themen.
Dropdown-Menü-Komponente
Eine reaktionsschnelle Dropdown-Menükomponente, die für den geschäftlichen Gebrauch entwickelt wurde und Mikrointeraktionen und Komplementärfarben bietet. Es unterstützt sowohl helle als auch dunkle Themen und verwendet Tailwind CSS für das Styling.
Retro Blog Dropdown-Menü
Ein responsives Retro-Vintage-Dropdown-Menü für Blog-Inhalte. Verfügt über ein einfaches triadisches Farbschema und Unterstützung für den Dunkelmodus mit Tailwind CSS. Kein JavaScript.