사용자가 웹 사이트 콘텐츠를 검색할 수 있습니다.
Tailwind CSS로 디자인된 미니멀한 검색 상자 구성 요소로, 반응형 효과와 어두운 테마 지원을 제공합니다.
<div class="flex justify-center items-center p-4"> <div class="w-full max-w-md"> <form class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-4"> <div class="relative"> <input type="text" class="w-full py-2 pl-10 pr-4 border border-gray-300 rounded text-gray-700 dark:text-gray-300 dark:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400" placeholder="Search..." /> <svg class="absolute left-3 top-2.5 w-5 h-5 text-gray-500 dark:text-gray-400" 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="M10.5 17.5a7 7 0 100-15 7 7 0 000 15zm0 0l5 5m-5-5l-5-5"/> </svg> </div> <button type="submit" class="mt-4 w-full py-2 px-4 bg-blue-500 hover:bg-blue-600 text-white rounded focus:outline-none focus:ring-2 focus:ring-blue-400 dark:bg-blue-700 dark:hover:bg-blue-600 dark:focus:ring-blue-500">Search</button> </form> </div> </div>
Tailwind CSS를 사용하여 어두운 테마를 지원하는 브루탈리즘 스타일로 디자인된 반응형 검색 상자 구성 요소입니다.
<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>