Компоненты Выпадающее меню Компонент выпадающего меню

Компонент выпадающего меню

Адаптивный компонент выпадающего меню, разработанный с микровзаимодействиями и поддержкой темной темы с использованием Tailwind CSS.

Предварительный просмотр

HTML-код

<div class="relative inline-block text-left">
  <div>
    <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-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
      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.39l3.71-3.18a.75.75 0 111 1.12l-4.25 3.5a.75.75 0 01-1 0l-4.25-3.5a.75.75 0 010-1.12z" clip-rule="evenodd" />
      </svg>
    </button>
  </div>

  <div class="dropdown-content origin-top-right absolute left-0 z-10 mt-2 w-56 rounded-md shadow-lg bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5 focus:outline-none transition ease-out duration-100 transform scale-95 opacity-0">
    <div class="py-1" role="menu" aria-orientation="vertical" aria-labelledby="options-menu">
      <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 transition-colors duration-150 ease-in-out" role="menuitem">
        <img class="h-8 w-8 rounded-full mr-2" src="https://randomuser.me/api/portraits/men/32.jpg" alt="User Avatar" />
        Profile
      </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 transition-colors duration-150 ease-in-out" role="menuitem">
        <img class="h-8 w-8 rounded-full mr-2" src="https://randomuser.me/api/portraits/women/44.jpg" alt="User Avatar" />
        My Account
      </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 transition-colors duration-150 ease-in-out" role="menuitem">
        <img class="h-8 w-8 rounded-full mr-2" src="https://randomuser.me/api/portraits/men/20.jpg" alt="User Avatar" />
        Log out
      </a>
    </div>
  </div>
</div>

<style>
  [data-theme="dark"] .dropdown-content {
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
  }
  .dropdown-content:hover {
    opacity: 1;
    transform: scale(1);
  }
</style>

Связанные компоненты

Компонент выпадающего меню 20

Компонент выпадающего меню с брутальным стилем оформления с использованием Tailwind CSS, с адаптивными эффектами и поддержкой темной темы.

Открытый

Компонент выпадающего меню

Компонент выпадающего меню, разработанный в стиле Glassmorphism, с отзывчивыми эффектами и поддержкой темной темы с использованием Tailwind CSS.

Открытый

Компонент выпадающего меню

Адаптивный компонент выпадающего меню, разработанный в соответствии с принципами Material Design с использованием Tailwind CSS, поддерживающий темный режим и включающий изображения-заполнители.

Открытый