Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Tailwind CSS Tutorial
  • Tailwind Interview Questions
  • Tailwind Layout
  • Tailwind Flexbox
  • Tailwind Grid
  • Tailwind Alignment
  • Tailwind Spacing
  • Tailwind Sizing
  • Tailwind Typography
  • Tailwind Backgrounds
  • Tailwind Borders
  • Tailwind Effects
  • Tailwind Filters
  • Tailwind Tables
  • Tailwind Transitions and Animation
  • Tailwind Transforms
  • Tailwind Interactivity
  • CSS Frameworks
  • Web Technology
Open In App
Next Article:
How to make a Split Navigation Bar in Tailwind CSS ?
Next article icon

How to Create a Navigation Bar with Icons in Tailwind CSS ?

Last Updated : 14 Mar, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

A navigation bar, commonly known as a nav bar, serves as a fundamental component of user interface design, facilitating seamless navigation across a website or application. Using the icons in the navigation bar gains a distinctive advantage in visual communication. Icons streamline navigation by using universally recognized symbols instead of lengthy textual labels.

Screenshot-2024-03-05-153310

Approach:

  • Utilize Bootstrap's navbar component to create a responsive navigation bar.
  • Use the 'navbar-brand' class for the logo and 'navbar-toggler' for the collapsible button on smaller screens.
  • Incorporate icons from Font Awesome using <i> tags within the <a> elements for each navigation item.
  • Ensure proper alignment and spacing with Bootstrap's utility classes and grid system.

Example: Implementation to create a navigation bar with Icons in Tailwind CSS.

HTML
<html lang="en">  <head>     <meta charset="UTF-8">     <meta name="viewport"            content="width=device-width, initial-scale=1.0">     <title>           Fixed Collapsing Navbar in Bootstrap 5       </title> </head>  <body>     <nav class="navbar navbar-expand-lg navbar-light fs-5">         <div class="container">             <a class="navbar-brand"                 href="https://www.geeksforgeeks.org/">                 <img src= "https://media.geeksforgeeks.org/gfg-gg-logo.svg"                       class="rounded float-start">             </a>             <!-- Toggler button for small screens -->             <button class="navbar-toggler" type="button"                      data-bs-toggle="collapse"                     data-bs-target="#navbarSupportedContent"                      aria-controls="navbarSupportedContent"                      aria-expanded="false"                     aria-label="Toggle navigation">                 <span class="navbar-toggler-icon"></span>             </button>              <!-- Collapsible content -->             <div class="collapse navbar-collapse"                   id="navbarSupportedContent">                 <ul class="navbar-nav me-auto mb-2 mb-lg-0">                     <li class="nav-item">                         <a class="nav-link active text-success"                             aria-current="page" href="#">                             <i class="fas fa-home"></i> Home                         </a>                     </li>                     <li class="nav-item">                         <a class="nav-link" aria-current="page" href="#">                             <i class="fas fa-user"></i> About                         </a>                     </li>                     <li class="nav-item">                         <a class="nav-link" aria-current="page" href="#">                             <i class="fas fa-briefcase"></i> Services                         </a>                     </li>                     <li class="nav-item">                         <a class="nav-link" aria-current="page" href="#">                             <i class="fas fa-envelope"></i> Contact                         </a>                     </li>                  </ul>                 <form class="d-flex">                     <input class="form-control me-2" type="search"                             placeholder="Search" aria-label="Search">                     <button class="btn btn-outline-success" type="submit">                         Search                     </button>                 </form>             </div>         </div>     </nav>     <link href= "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"            rel="stylesheet">     <script src= "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js">     </script>     <link href= "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"            rel="stylesheet"> </body>  </html> 

Output:

mjkc


Next Article
How to make a Split Navigation Bar in Tailwind CSS ?

H

haneesr8pj
Improve
Article Tags :
  • Web Technologies
  • Tailwind CSS
  • Tailwind CSS-Questions

Similar Reads

  • How to create a Responsive Navigation Bar in Tailwind CSS ?
    A Responsive Navigation Bar with collapsible elements is a crucial component of modern web design, allowing users to navigate seamlessly across various screen sizes. In this article, we'll explore how to implement such a navigation bar using Tailwind CSS, a utility-first CSS framework that enables r
    2 min read
  • How to create a split navigation bar using CSS ?
    The article will demonstrate how to create a split navigation bar using CSS. There are two ways to make the split navigation bar these are with the help of flexbox properties and CSS position property. A split navigation bar is a popular layout where navigation links are divided into two sections. I
    4 min read
  • How to make a Split Navigation Bar in Tailwind CSS ?
    Split Navigation Bars in Tailwind CSS implement the different classes that help to distribute the content across the header of a webpage, providing a visually balanced layout. By separating navigation items into distinct sections, it becomes easier for users to identify and access different parts of
    3 min read
  • How to create a top navigation bar using CSS?
    A top navigation bar is a horizontal bar that typically contains links to different sections of a website. It is a fundamental part of a website's layout and helps users navigate easily. In this article, we will explore different approaches to creating a top navigation bar using CSS. These are the f
    3 min read
  • How to Install Tailwind CSS with Create React App?
    We will see how to set up Tailwind CSS in a React project using the Create React App. Tailwind CSS is a utility-first CSS framework that allows for rapid development of custom user interfaces. When combined with Create React App, it offers a flexible approach to build modern React applications. Prer
    2 min read
  • How to Create a Navigation Bar with CSS Flexbox?
    The navigation bar is a crucial aspect of modern web design. We can create a responsive navigation bar using CSS Flexbox, which provides a flexible and efficient way to layout elements, making it an excellent choice for creating navigation bars. Below are different possible ways for creating differe
    5 min read
  • How to Create A Nested Menus in Tailwind CSS?
    TailwindCSS allows designers to create highly customizable and visually appealing interfaces using utility-first classes. With its extensive set of utilities, you can build nested menus that are both responsive and stylish. Tailwind's flexible styling options make it easy to design complex, nested m
    6 min read
  • How to change svg icon colors with Tailwind CSS ?
    SVG stands for Scalable Vector Graphics and is an XML-based ( can be edited ) vector image format. SVG is commonly used for icons, animations, interactive charts, graphs, and other dynamic graphics in the browser. As it is XML-based, you can easily edit or change the SVG icon colors with Tailwind. A
    3 min read
  • How to Create a Navigation Bar with Material-UI ?
    The Navigation Bar Material UI component provides an efficient way to navigate through web application pages. React utilizes material UI NavBar for responsive and flexible navigation that is easy to implement and also provides animated transitions. ApproachTo create responsive top Navigation Bar Mat
    3 min read
  • How to Create A Sticky NavBar Using Tailwind CSS?
    Sticky Navbar in Tailwind CSS is mostly used in applications where maintaining quick access to navigation links is essential as users scroll through content. It ensures that the navbar remains visible at the top of the screen, enhancing user experience by providing constant access to key sections of
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences