组件 搜索框 搜索框组件

搜索框组件

一个响应式搜索框组件,采用粗犷主义风格设计,支持深色主题,使用 Tailwind CSS。

预览

HTML 代码

<div class="flex items-center justify-center min-h-screen bg-gray-900 text-white">
    <div class="bg-gray-800 p-8 rounded-lg shadow-lg space-y-4">
        <h1 class="text-3xl font-bold text-center">Search</h1>
        <div class="flex items-center bg-gray-700 p-2 rounded-md">
            <input type="text" placeholder="Type to search..." class="flex-grow bg-transparent border-none text-white outline-none placeholder-gray-400" />
            <button class="ml-2 bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600 transition duration-300">Go</button>
        </div>
        <div class="text-center">
            <img src="https://picsum.photos/200/100" alt="Placeholder image" class="w-full h-auto rounded-md mt-4">
        </div>
        <div class="flex items-center justify-between mt-4">
            <img src="https://randomuser.me/api/portraits/men/1.jpg" alt="Avatar" class="w-12 h-12 rounded-full">
            <span class="text-sm">User Name</span>
        </div>
    </div>
</div>
<style>
    @media (prefers-color-scheme: dark) {
        body {
            background-color: #1F1F1F;
        }
        .bg-gray-800 {
            background-color: #2d2d2d;
        }
        .bg-gray-700 {
            background-color: #3e3e3e;
        }
    }
</style>

相关组件

Glassmorphism 搜索框

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

打开

游戏搜索框组件

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

打开

搜索框组件

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

打开