组件 搜索框 搜索框组件

搜索框组件

一个使用 Tailwind CSS 样式的复古/复古搜索框组件。它具有响应式设计、暗黑主题支持和占位符图片。

预览

HTML 代码

<div class="flex flex-col items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
    <div class="w-full max-w-md p-6 bg-white dark:bg-gray-800 rounded-lg shadow-md">
        <h2 class="text-2xl font-bold text-center text-gray-800 dark:text-white mb-4">Search</h2>
        <div class="relative">
            <input type="text" class="w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring focus:ring-blue-500 dark:focus:ring-blue-400 placeholder-gray-400 dark:placeholder-gray-500" placeholder="Type your query..." />
            <button class="absolute inset-y-0 right-0 flex items-center px-4 text-white bg-blue-600 hover:bg-blue-700 rounded-r-lg focus:outline-none focus:ring focus:ring-blue-500 dark:bg-blue-500 dark:hover:bg-blue-600">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 4a7 7 0 100 14 7 7 0 000-14z" />
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-4.35-4.35" />
                </svg>
            </button>
        </div>
    </div>
    <div class="mt-10 flex">
        <img src="https://picsum.photos/200/100?random=1" alt="Placeholder Image" class="rounded-lg shadow-md" />
        <img src="https://picsum.photos/200/100?random=2" alt="Placeholder Image" class="rounded-lg shadow-md ml-4" />
    </div>
    <div class="mt-6 flex items-center">
        <img src="https://randomuser.me/api/portraits/men/32.jpg" alt="Avatar" class="w-10 h-10 rounded-full shadow-md" />
        <p class="ml-2 text-gray-800 dark:text-white">User Name</p>
    </div>
</div>

相关组件

复古搜索框

复古/复古搜索框,具有80s/90s美学,响应式,支持黑暗模式。

打开

搜索框组件

一个响应式搜索框组件,采用Material Design原则设计,具有Tailwind CSS样式和深色主题支持。

打开

野兽派搜索框

具有鲜艳色彩和深色主题支持的野兽派搜索框组件。

打开