A user-friendly application is created using multiple user-interface modules; one such module is a search box, or search bar. In this post, we are showcasing visually stunning 50+ HTML and CSS search box code examples that we have gathered from CodePen, GitHub, and other reliable platforms.

A search bar allows users to input a search term or query, which retrieves relevant content or information within a fraction of a second.  From simple search bars to animated search bars and extending search boxes to pure CSS search boxes, we have a wide array of search boxes for web designers and developers.

Each search box code snippet comes with unique and stylish options that can enhance the aesthetics as well as the functionality of your web applications. So, let’s explore our top CSS search box collection and make your site visitors lives hassle-free.

1. Search Box Practice #3


Author: nikhil
Source:  Code / Demo
Created on: JANUARY 17, 2014
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

2. Search Box Focus Effect


Author: Chris Smith
Source:  Code / Demo
Created on: FEBRUARY 8, 2019
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS)

3. CSS Search Box


Author: Jamie Coulter
Source:  Code / Demo
Created on: JANUARY 12, 2016
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML(Haml), CSS(SCSS)

4. Extending Search


Author: Daniel Riemer
Source:  Code / Demo
Created on: APRIL 28, 2014
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML(Haml), CSS

5. Make Search Box Animation


Author: Coding Script
Source:  Code / Demo
Created on: JULY 21, 2020
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

6. Expandable Searchbar Animation


Author: Menelaos
Source:  Code / Demo
Created on: SEPTEMBER 12, 2018
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

7. Search bar


Author: Takane Ichinose
Source:  Code / Demo
Created on: JULY 8, 2018
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

8. CSS Animated Search Box Concepts


Author: Brandon Kennedy
Source:  Code / Demo
Created on: OCTOBER 14, 2014
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS), JavaScript

9. Simple Search Field (Pure CSS)


Author: Charlie Marcotte
Source:  Code / Demo
Created on: JULY 6, 2017
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML(Pug), CSS(Sass)

10. Animated search field


Author: htmlstrap
Source:  Code / Demo
Created on: DECEMBER 23, 2019
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

11. Pure CSS Search Box


Author: smotchysmooly
Source:  Code / Demo
Created on: FEBRUARY 4, 2014
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

12. Simple Search Bar


Author: Austin
Source:  Code / Demo
Created on: SEPTEMBER 24, 2014
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS)

13.  Expandable Search Box


Author: Morteza
Source:  Code / Demo
Created on: NOVEMBER 16, 2014
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

14. Search box v.2 (CSS Only)


Author: Takane Ichinose
Source:  Code / Demo
Created on: FEBRUARY 18, 2019
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML(Pug), CSS(SCSS)

15. Animated input search


Author: co0kie
Source:  Code / Demo
Created on: APRIL 25, 2020
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS)

16. Animated Search Box


Author: Aqib Hanief Bhat
Source:  Code / Demo
Created on: JANUARY 18, 2019
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

17. Search Box


Author: Uğur Can
Source:  Code / Demo
Created on: JUNE 20, 2020
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

18. Pure CSS Animated Search Bar


Author: Omar Sherif 
Source:  Code / Demo
Created on: OCTOBER 30, 2018
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

19. Google Metro Flatten


Author: nau.val();
Source:  Code / Demo
Created on: AUGUST 7, 2013
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML(Haml), CSS(Sass)

20. Increasing Input


Author: Shaw
Source:  Code / Demo
Created on: MAY 10, 2018
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS), JavaScript

21. Search Bar


Author: Jove Angelevski
Source:  Code / Demo
Created on: AUGUST 9, 2018
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS)

22. Expanding search bar with jQuery


Author: nikhil
Source:  Code / Demo
Created on: JANUARY 24, 2014
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS, JavaScript

23. Search input


Author: wontem
Source:  Code / Demo
Created on: APRIL 12, 2015
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(Sass)

24. Skeuomorphic search input


Author: Jonas Badalic
Source:  Code / Demo
Created on: DECEMBER 3, 2019
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS)

25. Search box


Author: B E K
Source:  Code / Demo
Created on: NOVEMBER 7, 2019
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

26. Expanding Input


Author: Steve Gardner
Source:  Code / Demo
Created on: MAY 12, 2018
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS), JavaScript

27. Pure CSS Search Box


Author: Focus Publications
Source:  Code / Demo
Created on: MAY 23, 2013
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

28. Animating search box


Author: Jarno van Rhijn
Source:  Code / Demo
Created on: FEBRUARY 3, 2016
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS)

29. Pure CSS expanding search with custom properties (no pre-Chromium Edge support)


Author: Ana Tudor
Source:  Code / Demo
Created on: AUGUST 10, 2018
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS)

30. placeholder-shown selector


Author: Liam
Source: Code / Demo
Created on: OCTOBER 12, 2019
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS)

31. Simple Search Bar


Author: Emily Huang
Source:  Code / Demo
Created on: MAY 30, 2014
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

32. Animated search input


Author: Lucas Henrique
Source:  Code / Demo
Created on: MAY 24, 2018
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML(Pug), CSS(Sass)

33. Top of the page search box

Author: Mike
Source:  Code / Demo
Created on: OCTOBER 2, 2015
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

34. Search Form

Author: Andrias
Source:  Code / Demo
Created on: APRIL 18, 2016
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(Less)

35. Pure CSS morphing-like search icon

Author: Fabien Butazzi
Source:  Code / Demo
Created on: AUGUST 6, 2015
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(Less)

36. Expanding text box/button

Author: Sam Daitzman
Source:  Code / Demo
Created on: FEBRUARY 21, 2014
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS), JavaScript

37. Search Box Animation

Author: Yuhomyan
Source:  Code / Demo
Created on: SEPTEMBER 13, 2020
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

38. Flat CSS search box concept with loading animation

Author: Ines Montani
Source:  Code / Demo
Created on: JANUARY 24, 2016
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML(Pug), CSS(Sass), JavaScript

39. Search Input Caret Jump

Author: Jon Kantner
Source:  Code / Demo
Created on: JULY 21, 2020
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

40. Awsome Search-Box

Author: Hamza Elkotp
Source:  Code / Demo
Created on: AUGUST 12, 2020
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

41. Search Form With Animated Search Button

Author: Himalaya Singh
Source:  Code / Demo
Created on: SEPTEMBER 15, 2018
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

42. CSS effect for search input

Author: Mihael Tomić
Source:  Code / Demo
Created on: MAY 29, 2017
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(PostCSS)

43. Job Search Platform UI

Author: Aysenur Turk
Source:  Code / Demo
Created on: SEPTEMBER 23, 2020
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSSCSS(SCSS), JavaScript

44. UI #2 – Search Bar

Author: Jove Angelevski
Source:  Code / Demo
Created on: AUGUST 9, 2018
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS)

45.  Search input animation

Author: Aaron Iker
Source:  Code / Demo
Created on: NOVEMBER 8, 2018
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS)

46. Search animation – Only CSS

Author: Milan Raring
Source:  Code / Demo
Created on: MARCH 8, 2020
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS)

47. Beautiful Search Box

Author: Ergün Ateşbahar
Source:  Code / Demo
Created on: NOVEMBER 14, 2019
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

48. CSS Stylish Search Box

Author: Suman Tapader
Source:  Code / Demo
Created on: MARCH 27, 2019
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS, JavaScript

49. Search Bar

Author: Cameron Baney
Source:  Code / Demo
Created on: DECEMBER 5, 2012
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS

50. Search Input Icon – UI

Author: cnjs
Source:  Code / Demo
Created on: JUNE 7, 2018
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS(SCSS)

51. Animated Search Interaction

Author: Jon Kantner
Source:  Code / Demo
Created on: DECEMBER 20, 2019
Compatible browsers: Chrome, Firefox, Opera, Edge, Brave
Made with: HTML, CSS