组件 搜索框 搜索框组件

搜索框组件

搜索框组件,具有深色模式 UI、单色配色方案和中等复杂性,适用于使用 Tailwind CSS 的社交媒体。支持深色主题的响应式设计。

预览

HTML 代码

<div class="min-h-screen bg-gray-100 dark:bg-gray-900 flex flex-col items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
  <div class="max-w-md w-full space-y-8">
    <div>
      <h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white">
        Search Your Friends
      </h2>
    </div>
    <div class="mt-8 relative">
      <input type="text" placeholder="Search..." class="block w-full pl-10 pr-3 py-2 border border-gray-300 dark:border-gray-700 rounded-md leading-5 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm">
      <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
        <svg class="h-5 w-5 text-gray-400 dark:text-gray-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
          <path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd" />
        </svg>
      </div>
    </div>

    <div class="bg-white dark:bg-gray-800 shadow overflow-hidden sm:rounded-md mt-4">
      <ul class="divide-y divide-gray-200 dark:divide-gray-700">
        <li class="px-4 py-4 sm:px-6 flex items-center space-x-3">
          <img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/men/1.jpg" alt="User Avatar">
          <div class="flex-1 min-w-0">
            <p class="text-sm font-medium text-gray-900 dark:text-white truncate">John Doe</p>
            <p class="text-sm text-gray-500 dark:text-gray-400 truncate">@johndoe</p>
          </div>
        </li>
        <li class="px-4 py-4 sm:px-6 flex items-center space-x-3">
          <img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/women/2.jpg" alt="User Avatar">
          <div class="flex-1 min-w-0">
            <p class="text-sm font-medium text-gray-900 dark:text-white truncate">Jane Smith</p>
            <p class="text-sm text-gray-500 dark:text-gray-400 truncate">@janesmith</p>
          </div>
        </li>
         <li class="px-4 py-4 sm:px-6 flex items-center space-x-3">
          <img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/men/3.jpg" alt="User Avatar">
          <div class="flex-1 min-w-0">
            <p class="text-sm font-medium text-gray-900 dark:text-white truncate">Peter Jones</p>
            <p class="text-sm text-gray-500 dark:text-gray-400 truncate">@peterj</p>
          </div>
        </li>
      </ul>
    </div>
  </div>
</div>

相关组件

搜索框组件

带有3D设计、响应效果和黑暗主题支持的搜索框组件。

打开

搜索框组件

适用于商业/公司网站的响应式搜索框组件,具有微交互和类似的配色方案。它包括一个搜索输入、一个按钮和一个带有用户头像和文本的动态结果下拉列表,支持深色模式。

打开

游戏搜索框组件

一个响应式的简单搜索框组件,适用于游戏网站,其灵感来自包豪斯设计原则,具有森林/绿色调色板和深色模式支持。

打开