Buttons with icons
Bootstrap 5 Buttons with icons component
Responsive buttons with icons built with Bootstrap 5. Enhance your web design with stylish, intuitive buttons that include icons for improved user experience.
Floating
Use .btn-floating
class to make a circle button.
To make it works properly you have to put an icon inside. The text will not fit in. You can find hundreds of available icons in our icons docs.
<button type="button" class="btn btn-primary btn-floating" data-mdb-ripple-init>
<i class="fas fa-download"></i>
</button>
// Initialization for ES Users
import { Ripple, initMDB } from "mdb-ui-kit";
initMDB({ Ripple });
You can apply almost all the same classes and attributes to the floating buttons as to the regular buttons - colors, ripples, sizes, outline, etc.
<button type="button" class="btn btn-primary btn-floating" data-mdb-ripple-init>
<i class="fas fa-gem"></i>
</button>
<button type="button" class="btn btn-outline-success btn-floating" data-mdb-ripple-init data-mdb-ripple-color="dark">
<i class="fas fa-star"></i>
</button>
<button type="button" class="btn btn-danger btn-floating" data-mdb-ripple-init>
<i class="fas fa-magic"></i>
</button>
<button type="button" class="btn btn-dark btn-floating" data-mdb-ripple-init>
<i class="fab fa-apple"></i>
</button>
// Initialization for ES Users
import { Ripple, initMDB } from "mdb-ui-kit";
initMDB({ Ripple });
Text
You don't need to use only an icon. You can add text to the button. Remember to add some
spacing classes (for example .me-2
) to provide a proper space between icon and
text.
<a class="btn text-white" data-mdb-ripple-init style="background-color: #55acee;" href="#!" role="button">
<i class="fab fa-twitter me-2"></i>
Twitter
</a>
// Initialization for ES Users
import { Ripple, initMDB } from "mdb-ui-kit";
initMDB({ Ripple });
Only icon
By removing button classes and replacing background-color
with
color
you can create minimalistic, clickable icons.
<!-- Facebook -->
<a style="color: #3b5998;" href="#!" role="button">
<i class="fab fa-facebook-f fa-lg"></i>
</a>
<!-- Twitter -->
<a style="color: #55acee;" href="#!" role="button">
<i class="fab fa-twitter fa-lg"></i>
</a>
<!-- Google -->
<a style="color: #dd4b39;" href="#!" role="button">
<i class="fab fa-google fa-lg"></i>
</a>
<!-- Instagram -->
<a style="color: #ac2bac;" href="#!" role="button">
<i class="fab fa-instagram fa-lg"></i>
</a>
Notifications
By using a badge you can create a button with a notification to provide a counter.
<a class="btn text-white" data-mdb-ripple-init style="background-color: #3b5998;" href="#!" role="button">
<i class="fab fa-facebook-f"></i>
<span class="badge bg-danger ms-2">8</span>
</a>
// Initialization for ES Users
import { Ripple, initMDB } from "mdb-ui-kit";
initMDB({ Ripple });