In this video, I'm going to demonstrate how you can customise your buttons. I have two buttons here and in the process of customising them, making changes, we're going to talk about styling in Bubble and also UX, which stands for User Experience. In the course of building our apps, we want to reduce confusion and make our apps as easy to use as possible for our users. So let's dive right into it. And we're going to have this as our secondary button.
Primary buttons and styles
I'll rename it and this as our primary button. So at the moment, the button is styled as the primary button, which is a style that Bubble provides when I created this app. And so if I toggle off from here, or you can do the same thing by clicking Remove Style, I can then go ahead and I can make changes to the button. So there you go. You can see the colour has changed, but this will only apply to this individual button.
This is where styles come in, which can be accessed through the tab here or through the drop down here on the inspector. So if I go back onto primary button, you can see it reverts back to the primary button style and I can edit the primary button style here. So let's say instead of a blue, I want to go for a purple. And let's say we want a lot more rounding and to increase the letter spacing, because sometimes that looks quite good on a button. And now you can see that both buttons have changed because both are the primary button.
Now, there's one other thing we can do here, which is that when the user hovers over it, this is when we're moving into the UX territory, we want the button to change to indicate that a hover has taken place. So remember, I'm in the styles panel because I want this to apply to every primary button. So I'm going to say when button is hovered and then select the background colour and I'm going to go a little bit darker and we can preview that by toggling it here. And then if I hit preview, we can see what's happened so far. So now, when my mouse goes over the button, it changes colour on the mouse hover, a good bit of UX to incorporate where possible.
Let's work on our second button. So this is going to be our secondary button and I'm going to start with the primary because I want it to be similar, consistent, but let's make a few changes. So I'm going to make the font size a little bit smaller, get rid of the additional letter spacing. Now, instead of having it solid to indicate that it's secondary, let's give it a border instead.
Let's give it a border of two and then we will get rid of the background colour and update the font colour. There we go. And at the moment, button hovered, it's removed the background because I no longer have a background styling effect, but I still want something to happen. So in fact, I'm going to make the background white. And so then when it's hovered background colour and then I'm going to make this a light grey.
Let's preview that.
So there you see, it fades into the light grey. We could also to really demonstrate that it's been hovered, we can change the border colour. And so rather than sliding the droplet across here to set a lighter purple, I'm going to change the transparency.
It's not had a huge effect. Take that all the way down to there.
Button styles - outlines
Okay, there you go. It changes the outline of the button as well.
So I've created my secondary button and now let's make a style out of it. Because I want to be able to deploy the secondary button with my conditional, with my styling here, elsewhere in my app, so I can go on to style and click create new style.
And this then means that if I was to draw a button down here and I want that to be styled like my secondary button, it now carries the style across. And if I make changes in here, make that really big for some reason you can see the changes are reflected wherever the secondary button is set as the style.