组件 搜索框 搜索框组件

搜索框组件

一个简单的 retro/vintage 风格的搜索框组件,专为博客或内容消费而设计。它使用单色配色方案,并支持深色主题。

预览

HTML 代码

<div class="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900 p-4">
    <div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-4 w-full max-w-md">
        <h2 class="text-center text-2xl font-semibold text-gray-800 dark:text-gray-200 mb-4">Search</h2>
        <div class="relative">
            <input type="text" placeholder="Search..." class="block w-full px-4 py-2 text-gray-800 dark:text-gray-200 placeholder-gray-400 dark:placeholder-gray-600 border rounded-lg focus:outline-none focus:border-gray-500 dark:focus:border-gray-600" />
            <div class="absolute inset-y-0 right-0 flex items-center pr-2">
                <button class="bg-blue-500 dark:bg-blue-700 text-white rounded-lg p-2 hover:bg-blue-400 dark:hover:bg-blue-600 transition duration-200">
                    <svg class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 3a8 8 0 11-8 8 8 8 0 018-8z" />
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-4.35-4.35" />
                    </svg>
                </button>
            </div>
        </div>
    </div>
</div>

相关组件

搜索框组件

采用拟物风格设计的搜索框组件,模仿现实世界的搜索框,使用三分色彩方案,适用于作品集,并支持暗模式的响应式设计。

打开

搜索框组件

一个响应式搜索框组件,具有极简/扁平化设计、充满活力的配色方案和复杂的交互,适用于商业/公司网站。它支持深色模式,并使用 Tailwind CSS 构建。

打开

Glassmorphism 搜索框

一个简单、响应式的 glassmorphism 搜索框组件,具有灰度颜色,适用于仪表板。支持深色模式。

打开