, or elements:
Example
<a href="" class=">
btn btn-info
"
role
=
"
button
"
Link button
a
<button type="button" class=">
btn btn-info
"
button
button
<input type="button" class=">
btn btn-info
"
value
=
"
Input Buttons
"
<input type="submit" class=">
btn btn-info
"
value
=
"
submit button
"
<input type="reset" class=">
btn btn-info
"
value
=
"
Reset Button
"
Try it »
Button Borders
Bootstrap 5 can also set multiple borders on buttons, adding a highlight effect when the mouse moves over the button:
Example
<button type="button" class=">
btn btn-outline-primary
"
Primary Buttons
button
<button type="button" class=">
btn btn-outline-secondary
"
Secondary Buttons
button
<button type="button" class=">
btn btn-outline-success
"
Success
button
<button type="button" class=">
btn btn-outline-info
"
Information
button
<button type="button" class=">
btn btn-outline-warning
"
Warning
button
<button type="button" class=">
btn btn-outline-danger
"
Danger
button
<button type="button" class=">
btn btn-outline-dark
"
black
button
<button type="button" class=">
btn btn-outline-light text-dark
"
Light
button
Try it »
Buttons of Different Sizes
Bootstrap 5 can set button sizes, using the .btn-lg class for large buttons and the .btn-sm class for small buttons:
Example
<button type="button" class=">
btn btn-primary btn-lg
"
Large Buttons
button
<button type="button" class=">
btn btn-primary
"
Default button
button
<button type="button" class=">
btn btn-primary btn-sm
"
Small Buttons
button
Try it »
Block-level buttons
Block-level buttons can be set by adding the .btn-block class, and the .d-grid class is set on the parent element:
Example
<div class="d-grid">
<button type="button" class=">
btn btn-primary btn-block
"
Button 1
button
div
Try it »
If there are multiple block-level buttons, you can use the .gap-* classes to set them:
Example
<div class=">
d-grid gap-3
"
<button type="button" class=">
btn btn-primary btn-block
"
100% Width Button
button
<button type="button" class=">
btn btn-primary btn-block
"
100% Width Button
button
<button type="button" class=">
btn btn-primary btn-block
"
100% Width Button
button
div
Try it »
Active and Disabled Buttons
Buttons can be set to an active or disabled (non-clickable) state.
Example
<button type="button" class=">
btn btn-primary active
"
Clicked Button
button
<button type="button" class=">
btn btn-primary
"
disabled
Disabled Button
button
<a href="" class=">
btn btn-primary disabled
"
Disabled Link
a
Try it »
Loading Button
We can also set up a button that is loading.
Example
<button class=">
btn btn-primary
"
<span class=">
spinner-border spinner-border-sm
"
span
button
<button class=">
btn btn-primary
"
<span class=">
spinner-border spinner-border-sm
"
span
Loading..
button
<button class=">
btn btn-primary
"
disabled
<span class=">
spinner-border spinner-border-sm
"
span
Loading..
button
<button class=">
btn btn-primary
"
disabled
<span class=">
spinner-grow spinner-grow-sm
"
span
Loading..
button
Try it »