Hi everyone. And this video we're gonna make this, it is our search icon, inner circle. But watch when I click it, oh, it expands. Look at that. The text appears nice. It's got a little bounce to it.
Let me show you how to make this in Figma, right? To get started, I'm actually working on my main styles and components. Uh, you know, I should be making my main components here and then putting in them into the various design documents afterwards through a shared library. Okay? So let's do it that way. And I've got a frame in here that just is a placeholder for the size that I'm gonna need the search bar.
And I've got these two parts. Uh, I'm gonna select both of them. Okay? So just an icon, a bit of text. I'm gonna lower the capacity of this one five on your keyboard to lower it to 50%. So both of them shift A to make it r auto layout doesn't have to be an auto layout, but we like auto layouts 'cause it allows us to do things like padding.
I'm gonna go 16, tab eight, okay? And I'm gonna give it a fill. I'm gonna use white, okay? 'cause I've got an off white on the background here. I'm probably gonna need a drop shadow or line around the outside something. The other thing I wanna do is I wanna make it round 'cause I like that kind of bouncing in and out of that circle.
Okay? So you wanna drag this up, you can keep dragging it outright, okay? You just need to keep going to a high number, okay? So that it's perfectly round. I just type in a hundred. It's way more than I need, but at least it makes it perfectly round.
Cool. Next thing I wanna do is, let's make this a component. Do I wanna do that first? I don't think it matters. Let's make it a component. Let's give it a name, search bar.
Okay, I'm gonna get it at the right size to start with. It's gonna say you go out that way. This is probably gonna need, let's put in a drop shadow. Let's start with drop shadow and I'll show you a stroke in a bit. Okay, drop shadow. Which one?
1, 1 2. The opacity is gonna be 10. Is that enough? Probably not. Just, okay, that'll do. Okay, so this thing now needs two variants.
Okay, so component two variants. This first one needs to be kind of trimmed down and it should work if I, I know it's not clipping there. We'll clip that out in a second. Let's just see if the mechanics work. So shift E, I'm gonna say U at the top. This bar here.
We want the parent. Okay, so we want this default one to when it's clicked, switch to variant two and use smart animate. And I'm gonna use, what am I gonna use? Bouncy. Okay. And when it comes back the other way, I'm going to use not bouncy.
Let's use quick, let's give it a test. So leave our main component out here. Grab our instance. Not the whole thing. Just this part here. You can't do a duplicate.
Oh you can, I'm in uh, prototype mode. I'm switching back to design mode. Make things easier. So let's give it a preview. Okay, I'm gonna say, yep. Oh, it's kind of working.
The circle's working. What we wanna do for the last part is we wanna say you at the top here. We could just say that this is set to hide. Okay. Command shift H Control shift H. So it's hidden on this one, but there on this one, let's have a look.
So, yep, yep, yep, yep. Kind of works but it kind of fades in and the bounce on liking less and less. So I'm gonna turn the bounce off. Let's go quick and one on the way back we'll use quick as well. Okay, so let's give it a go. You.
It's not working at all. R for refresh, go back to here. Realize you haven't set a starting flow on prototype so that we can at least when we hit refresh it comes back to this page here and it's still not working. Cool. What did I break? You Wait there.
Alright, we're back. Yeah, just closing and opening. It seemed to fix it. I'm having more problems in this course than I normally have in Figma. Normally it's super reliable and you might find it super reliable for you but sometimes you need to, yeah, turn it off and turn it back on again. So let's have a look.
Okay, so what we wanna do is instead of hiding it, so let's have a look in variant two. Let's turn the eyeball back on. Nope, the default. Let's turn the eyeball back on this one. Okay, what we're gonna do is actually just say the default variant. We're gonna go to design view and say clip contents and let's see if it works.
Keep testing and it works kind of. Can you see the, the editor will zoom in. Can you see the weird pixelization? Okay, this something that never used to happen. Now what happens? I bet you when you are using it, it doesn't happen.
I think I know what it is. Is that this one here we set clipping to and we didn't for this doesn't really need it but it doesn't like to transfer between the two. Let's have a look. There you go. Now it's nice. Woo-hoo.
Okay, so a couple of things is that it's clipped, which is great and what I probably wanna do in this version, so command click actually I went too far into the vector. I want the uh, component of my little magnifying glass. Now I can't move it around 'cause it's inside of an auto layout. So that's where maybe not using an auto layout and just using a frame with 'em sitting inside we can make it work. Okay, I can click on this one here. Now if yours is not perfectly round up here, mine just accidentally ended up being the same height as the width.
That's why it's um, you know if yours is like this and it's not quite looking right, just make sure whatever the height is is the width. Now we can mess around with this top ones padding, okay? And just try and get it lined up in the middle. Okay? You can break it into individual parts and start messing around with that. It's not gonna affect the second one.
Let's give it a go Now looks nicer. Probably need it a bit smaller there as well. So you are gonna use scale. So the K tool, I'm gonna make it 0.75 about the right size. I messed around with my parent so I'm gonna say you are 40 but instead of hug contents, I'm gonna say you a 40 as well. Yep.
Let's mess around with this. I want you over that way a bit. I think we're good. Boop boop, boop boop. There we go. Very cool.
Scales down, bounces down. I like it. Alright, one problem that I'm running into is watch this instead of a drop shadow, I'll leave the drop shadow on. But if I add a stroke to both of these because let's say that I want it to be, uh, actually let's put a stroke, let's give it a color. I'm gonna use my 300 neutral. Dismiss that.
There we go. And I put the same one on this. I'm gonna go stroke of 300. There we are. Now this gives it a little bit of pixelization as well. Can you see that?
Does some weird stuff with it. Can't deal with it at the moment. Check it for you. Let me know in the comments. Is it still doing the same for you with the stroke? I can't make it not do that at the moment.
There you go. Let's get ours a little bit more into position. Nice. All right, last thing we'll do before we go is let's get rid of the stroke 'cause it's making it look ugly. Um, but also we're gonna get it to pop from the right. Okay, so let's, I'll quickly get rid of the Stroke's like both of them hit minus both of them are gone and, and what we wanna do is we want it to be over here.
Okay? And let's preview it so it doesn't quite work. It kind of pushes from the other side. Well the defaults from the left. So what we can do is not in the main component. Okay?
We need to do it in the instance. It needs to see the parent frame and we can say actually let's use, right? It's gonna use that side to push off. Let's give it a go. Hey look at us. Nice.
I need to line it up 'cause it doesn't quite line up and you can totally do a stroke like when it's actually made in the app or in the website. Okay? But for us at the moment, there's just a tiny little mug in there and Figma, those sorts of bugs just disappear over time when they get lodged and when the team gets around to updating them. But for the moment, oh I love it. Okay, the last, last thing, I was looking at it and I was just about to finish the video and I was like, oh I can't live with that not being in the center. And then I was like, oh you know, do I just keep moving it and going back here?
I'm like, no, you don't do that. Okay, what you do is you go back to this one, okay? You say scroll to the top, find your different variants, your poorly named variant two, okay? Just switch it to that. Then you can select on it and get it right in the middle. Okay?
Then switch it back to default and say magic. Now it's perfectly lined up. And the last last thing is, 'cause I've put it on my main styles of components, I need to publish it. What I'll do is I will get this and put it in its own section and the shift s to make a section. Okay, I'm gonna make a section, I'm gonna name it Command R. Is this a field?
Actually can't think of what it should be. Is it a field? Does it go into other, I'm gonna copy that styling, put it onto this one and I'm gonna get you, you in the right bit. There we go. I am now gonna publish it. So remember option three, we've done this before, right?
Option three opens it up, okay, alt three on a pc, our libraries, we're gonna publish this change. Okay, there we go. Just one change. And now with this document here, now that I want to use it, I should be able to either go to my shift eye and type in search. Oh search even, okay. Or go to my assets panel and then I'm gonna drag this in.
I'm gonna move you guys all down. And there you go. I'm gonna have to switch this to that variant to get it to lined up nicely. There's something else I have to remember how to do. So let's switch it back to default. Oh, do you remember what we meant to do?
That's right. We're gonna say left. We're gonna make it right so that it starts over here and then variant pops out. Is it in the middle? There you go. In the middle.
Back to that one. Now let's preview it. There you go. Doing it properly. Making main components on our main styles and components. File, ensuring them with the rest of the team.
Alright, that is actually it now. A few little bonuses at the end there. Uh, onto the next video.