Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change react-bootstrap navbar-toggler-icon button and button color

I am trying to change the react-bootstrap navbar-toggler-icon to the font-awesome icon and also change the icon color.

Image for details:

enter image description here

like image 802
iamtheasad Avatar asked Apr 10 '20 05:04

iamtheasad


Video Answer


2 Answers

Find the Navbar.Toggle or directly Toggle (how it was imported, you'll see) in related navbar section.

<Navbar.Toggle aria-controls="basic-navbar-nav" />

As default and basicly it looks like this. Bootstrap's default is like what you see currently.

<Navbar.Toggle aria-controls="basic-navbar-nav"> <YOUR ICON /> </Navbar.Toggle>

Just add icon as a children inside Navbar.Toggle then you can style whatever you want.

like image 78
dogukyilmaz Avatar answered Oct 10 '22 11:10

dogukyilmaz


If you're using bootstrap icons, Here is my simple solution in 2021, replace this code with your favorite icon class.

Boostrap icons

<Navbar.Toggle aria-controls="basic-navbar-nav">
  {/* Replace your icon here */}
  <i class="bi bi-gear"></i>
</Navbar.Toggle>
like image 27
Asela Priyadarshana Avatar answered Oct 10 '22 10:10

Asela Priyadarshana