DevPlatform
Home
Components
Search
Submit
Earn
Login
Sign Up Free
Modern Search Bar - Preview | DevPlatform
DevPlatform
Categories
Accordion
Animation
Box Shadow
Button
Card
Footer
Form
Gallery
Hero Section
Inputs
Loader
Marquee
Modal
Modules
Navbar
Progress Bar
Radio Buttons
Search-Bar
Sections
Slider
Tab
Timeline
Toggle
Modern Search Bar
admin1234
Jan 30, 2026
12
0
Share
Live Preview
Refresh
Live Editor
HTML
CSS
JS
HTML
CSS
JavaScript
1
<div class="search-container"> <div class="search-wrapper"> <input type="text" class="search-input" placeholder="search..." autocomplete="off" > <button class="search-button" type="submit"> <svg class="search-icon" viewBox="0 0 24 24"> <circle cx="11" cy="11" r="8"></circle> <path d="m21 21-4.35-4.35"></path> </svg> </button> </div> </div>
1
* { margin: 0; padding: 0; box-sizing: border-box; } body { background: #d3d3d3; height: 100vh; display: flex; align-items: center; justify-content: center; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } .search-container { position: relative; width: 300px; } .search-wrapper { position: relative; background: white; border-radius: 50px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15); display: flex; align-items: center; padding: 8px 8px 8px 25px; transition: all 0.3s ease; } .search-wrapper:hover { box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2); } .search-wrapper:focus-within { box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25); } .search-input { flex: 1; border: none; outline: none; font-size: 18px; padding: 12px 20px 12px 0; background: transparent; color: #333; } .search-input::placeholder { color: #c0c0c0; } .search-button { background: #2d2d2d; border: none; width: 55px; height: 55px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; flex-shrink: 0; } .search-button:hover { background: #1a1a1a; transform: scale(1.05); } .search-button:active { transform: scale(0.95); } .search-icon { width: 24px; height: 24px; stroke: white; stroke-width: 2.5; fill: none; } /* Animation on page load */ @keyframes slideIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } } .search-container { animation: slideIn 0.5s ease-out; } /* Cursor blinking animation */ @keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } } .cursor { display: inline-block; width: 2px; height: 20px; background: #333; margin-left: 2px; animation: blink 1s infinite; }
1
Comments
0
Want to comment?
Please
login
or
sign up
to post comments.
No comments yet
Be the first to comment on this component!
Comments 0
Want to comment?
Please login or sign up to post comments.
No comments yet
Be the first to comment on this component!