![]() |
This article will show you how to add an icon in the navigation bar using React-Bootstrap. We will use React-Bootstrap because it makes it easy to use reusable components without implementing them. PrerequisitesCreating React App and Installing ModuleStep 1: Create a React application using the following command npx create-react-app foldername
Step 2: After creating your project folder i.e. foldername, move to it using the following command. cd foldername
Step 3: Now install React-bootstrap and bootstrap npm install react-bootstrap bootstrap
Step 4: Add Bootstrap CSS to index.js import 'bootstrap/dist/css/bootstrap.min.css';
Project Structure![]() Project Structure The updated dependencies in package.json will look like this: { Example: Now write down the following code in App.js file. Here App is our default component where we have written our code. Javascript
Steps To Run ApplicationStep: Run the application using following command from root directory of Application npm start
Output: Now open the browser and type the ‘http://localhost:3000/’ ![]() Navbar with Icon |
Reffered: https://www.geeksforgeeks.org
Geeks Premier League |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |