Create an Expandable Search Bar from Scratch (Vanilla JS)

DesignCourse on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateUI32 min

About this video

A tutorial that builds an icon-triggered search bar which expands into a full field, using vanilla JavaScript to change CSS, a typewriter-style placeholder and CSS animations. The accompanying CodePen lets viewers follow along.

What you’ll learn

  • Build an expanding search icon with vanilla JavaScript
  • Animate a search field's width with CSS transitions
  • Add a typewriter effect to an input placeholder