Bootstrap 5 Crash Course Tutorial #4 - Buttons & Button Groups
Key Takeaways
Demonstrates Bootstrap 5 button and button group classes
Full Transcript
all right then so the first real and probably most simple component that i want to show you is the bottom components now if we take a look at the button on the docs we can see at a glance there's loads of different button styles that we can use and different button sizes too and we can take advantage of the different theme colors for these buttons as well they're really easy to set up and they only use a couple of different classes so let's take a look at a few of them in the code alright so like we said there's loads of variations of buttons we can use so we're going to take a look at a few different examples some basic buttons some anchor tags as buttons different sizes different styles including the outlined one and also button groups so let's start with the basic buttons so i'm going to create a button tag like this first of all and i'll say primary button inside and i'm going to give this a class equal to btn now whatever button we create we always give it this base btn class every button has that and then we can customize it further like colorize it so i could say btn hyphen primary to give it a primary color and if i take a look at this now in the browser we can see this primary button right here and notice it automatically changes the text color to white as well when it has a slightly darker background so let's do another example i'm going to change this to secondary down here and then this to secondary as well and save that preview this and now we can see the gray button right here so we could do that with every different theme color let's also have a look at buttons as anchor tags so this is using the button tag right but any tag can have these button classes including atax so i'm gonna say a dot btn dot btn hyphen info which is another theme color and the href doesn't have to be anything inside here i'll say info anchor tag and save it and preview that and we can see the anchor tag looks the same but now it uses this information color instead and this time because the background's a little bit lighter it doesn't use the white text it keeps it as a darker black text all right so let's do another example i'm going to say button success for this one and change this to success as well save that and preview and we can see the green button awesome so like i said we can use any different tag as a button as long as we have the button class and whatever other class we want to stylize the button all right so these are all the same size buttons right here but we can make them smaller and also larger so if i say down here button and then give this a class of btn and then also a class of btn hyphen and it's going to be lg for a large button and also btn hyphen danger to stylize this remember danger was a theme color and there i'll say large danger button and i'm going to duplicate this so we can show you a small one so instead of lg right here we have small and when we don't apply a size to it it gets the default medium size just like these buttons so this is a larger button this is a smaller button and we'll change danger to warning so it's a different color and we'll say small and oops not the small tag small warning button all right so let's take a look at that and now we can see we have the large button and the small button all right then so let's take a look at the outlined style so i'm going to create down here some more buttons so i'll say button and then btn which is the base class then i'll say btn hyphen outline and then hyphen whatever color i want it to be so primary in our case so that means it's going to be an outline style button and the outline of the button is going to be that primary color so i'll say outlined primary button and then let's do another example down here so instead of primary this time i'll say secondary and also i'm going to make this large because we can apply sizes to these different styles of buttons as well so btn hyphen lg and here i'll say large outlined secondary button save that and preview and now we can see the outline style right here and when we hover over them it gives it the background color and changes the text to white which is nice same for this one but now it's a large button and we can also do the same for small buttons as well if we want to all right so the last thing i want to show you is the button groups and button groups are basically when you've got a series of buttons that belong together so let me show you an example i'm going to create a div first of all with a class of btn hyphen group and then all of the buttons that we're grouping together go inside this button group so i'm going to do anchor tags just for a change and then i'm going to give this a class of btn and also btn hyphen primary to make it the blue color and here i'll say in the href just hash and then as the text will say button one then i'm gonna duplicate these a couple of times so button two and button three so now all of these buttons are inside the button group and when they're inside the button group bootstrap styles the group of buttons a bit differently so if we save this we can see now they're all butted up to each other like that whereas before they have the white space in between them so that is a button group now each of these buttons can also have different colors so i could change this to warning and i could change this down here to success that's still going to work and we can see them all butted up to each other still all right so hopefully that gives you a good idea of how we can use buttons again we can use them on whichever tags we want doesn't have to be a button tag and we always use this base button class but then combine it with the different style classes to either colorize it or make it outlined or size it differently etc and by the way i'd always recommend checking out the docs for these components as well because there's way more examples of buttons and any other component we might use in this series as well then i'm going to show you so whatever component i might be showing you in this series there's probably at least 10 other ways that you can use it and customize it so definitely play around with different components once you've watched the videos next up though we're going to take a look at some of bootstrap 5's utility classes
Original Description
Hey gang, in this Bootstrap 5 tutorial I'll show you how to use the button classes and the button group component (to group buttons together).
🐱👤 View this course in full now - without ads - on Net Ninja Pro:
https://netninja.dev/p/bootstrap-5-crash-course
🐱💻 Access the course files on GitHub:
https://github.com/iamshaunjp/bootstrap-5-tutorial
🐱💻 HTML & CSS Crash Course:
https://www.youtube.com/watch?v=hu-q2zYwEYs&list=PL4cUxeGkcC9ivBf_eKCPIAYXWzLlPAm6G
🐱💻 Node.js Crash Course:
https://www.youtube.com/playlist?list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp
🐱💻 SASS Crash Course:
https://www.youtube.com/watch?v=St5B7hnMLjg&list=PL4cUxeGkcC9iEwigam3gTjU_7IA3W2WZA
🐱💻 VS Code - https://code.visualstudio.com/
🐱💻 Bootstrap 5 Docs - https://getbootstrap.com/docs/5.0/getting-started/download/
🐱💻 Social Links:
Facebook - https://www.facebook.com/thenetninjauk
Twitter - https://twitter.com/thenetninjauk
Instagram - https://www.instagram.com/thenetninja/
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Net Ninja · Net Ninja · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
GraphQL Tutorial #5 - Express App Setup
Net Ninja
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
GraphQL Tutorial #8 - Root Query
Net Ninja
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
GraphQL Tutorial #12 - Author Type
Net Ninja
GraphQL Tutorial #13 - Type Relations
Net Ninja
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
GraphQL Tutorial #18 - Mutations
Net Ninja
GraphQL Tutorial #19 - More on Mutations
Net Ninja
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
GraphQL Tutorial #23 - Create React App
Net Ninja
GraphQL Tutorial #24 - Book List Component
Net Ninja
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
GraphQL Tutorial #28 - Add Book Component
Net Ninja
GraphQL Tutorial #29 - External Query File
Net Ninja
GraphQL Tutorial #30 - Updating Component State
Net Ninja
GraphQL Tutorial #31 - Composing Queries
Net Ninja
GraphQL Tutorial #32 - query variables
Net Ninja
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
GraphQL Tutorial #34 - Book Details Component
Net Ninja
GraphQL Tutorial #36 - Styling the App
Net Ninja
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
Updated Vue & Firebase Course (Udemy)
Net Ninja
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja
Related Reads
📰
📰
📰
📰
Next.js vs Remix vs SvelteKit: Which Framework Should You Learn?
Dev.to · Etrit Neziri
Had my Frontend Developer interview with Capgemini (Application Developer) today, and I wanted to…
Medium · JavaScript
10 Frontend Developer Tools to Boost Productivity in 2026
Medium · Programming
10 Frontend Developer Tools to Boost Productivity in 2026
Medium · JavaScript
🎓
Tutor Explanation
DeepCamp AI