Learn the steps to creating a functional search bar and shopping cart icon for your digital design. This guide provides a comprehensive, step-by-step process of designing these features.
Key Insights
- The guide begins with creating a guide on the right-hand quarter of the artboard, adjusting the x-value to ensure the guide is accurately placed for the design of the search bar and shopping cart icon.
- Designing the search bar involves using various tools such as the rectangle tool for the bar, the ellipse tool for the magnifying glass, and the pen tool for the handle of the magnifying glass. The steps include creating the objects, grouping them, and adjusting their position to fit within the search bar.
- The final step involves grouping both the search bar and the magnifying glass as one object and saving the work. This design process provides a practical guide to creating functional and visually appealing search bars.
Note: These materials offer prospective students a preview of how our classes are structured. Students enrolled in this course will receive access to the full set of materials, including video lectures, project-based assignments, and instructor feedback.
In this video, we'll begin creating our search bar. For our search bar and shopping cart icon, we want them to be on the top-right-hand side of our artboard.
Let's position them in the right-hand quarter of the artboard. Therefore, let's create a guide. To do this, we'll click from the left ruler, place it roughly in the last quarter, and release.
Next, we go to our control bar and adjust the X value. To do this, we'll double-click the X value. Since we know that we have 1920 pixels across, we'll type 1920 divided by 4 and hit ENTER. We now have the number of pixels that make up one quarter.
We'll then go back to the X value and use the asterisk to multiply it by 3 and hit ENTER. We now know that this guide divides the third and fourth quarters within our artboard. Now, let's create our search icon.
To do this, let's zoom in and shift our perspective on the mouse while holding CTRL and scrolling down. To create our search bar, we'll first use the rectangle tool to draw the bar.
Dragging from the left guide, we'll create a bar of this size. Feel free to create a bar that you think is appropriate, then hit CTRL + Shift + A on the keyboard to deselect.
As we can see, our rectangle disappeared because it doesn't have a stroke or fill. So let's hit V on the keyboard to select it, then hit D on the keyboard for the default fill settings.
The default fill settings are white for the fill and black for the one-point stroke. Next, let's create the magnifying glass.
To do this, we'll use the ellipse tool, found in the tool gallery alongside the rectangle tool. We'll click and hold, then release over the ellipse tool.
We'll then create an ellipse, holding Shift to maintain the proportions of a circle. If we hit CTRL + Shift + A, we can deselect.
Next, let's use the Pen tool to create the handle for our magnifying glass. To do this, go to our toolbar and select the Pen tool.
The Pen tool is used by clicking at two different points. We'll click from the center, then create a line with our second click.
If we hold Shift, the line maintains a 45-degree angle, or depending on the angle you're at, it will move in 45-degree increments.
We'll release here for the length of our magnifying glass. As we can see, the Pen tool wants to continue adding points. To finish our line, hit Escape on the keyboard.
We now have one final change to make for our magnifying glass: moving the anchor point on the top right-hand side to intersect with our ellipse.
To do this, we'll hit A on the keyboard for the Direct Selection tool. We'll then click on the anchor and drag it along the pink line until it intersects with the ellipse.
Finally, let's group these two objects. We'll hit V for the Selection tool, click outside the line, and drag a selection over both the line and ellipse. Then, right-click to select 'Group.'
Finally, let's move the magnifying glass into the search bar.
To do this, I'll click and drag it so that the top and right intersect with the box. If we now zoom in, we'll drag the bottom-left point while holding Shift until it reaches the edge of the search bar.
I'll release slightly inside, then holding Shift again, release when it intersects with the bottom of the box.
Now that the search icon is inside the box, we just need to resize it. While holding Shift, I'll resize it from the right, dragging from the right-hand side to maintain proportions, and holding ALT to resize from the center.
I'll release when I'm happy with the size of the magnifying glass, hit D to ensure the stroke is still set to one point, and zoom out using CTRL—(MINUS) on the keyboard to view our work.
If we hit CTRL + Shift + A, we can deselect the magnifying glass, and we've now completed the search bar.
Let's select both objects using a selection box, right-click, and group them as one object.
Let's now save our work using CTRL + S on the keyboard, and we've completed the search bar. Well done! In the next video, we'll begin working on our shopping cart. See you there!