Navbar
Responsive navigation header, the navbar with link and dropdown menu.
Navbar with Offcanvas
<!-- Navbar -->
<nav x-data="{ open: false }" class="flex flex-nowrap lg:flex-start layhetgsjdcb z-20 top-0 start-0 end-0 bg-white dark:bg-gray-800 overflow-y-auto max-h-screen lg:overflow-visible lg:max-h-full">
<div class="container mx-auto uajskeiolksb xl:max-w-6xl ">
<!-- mobile navigation -->
<div class="flex klsuaonrmcha vlaoethsnkma py-3 lg:hidden">
<!-- logo -->
<a class="flex layhetgsjdcb py-2 me-4 text-xl" href="#">
<h2 class="text-2xl font-semibold text-gray-200 uajskeiolksb max-h-9 mklausjenrhtm"><img class="inline-block w-7 h-auto me-2 -mt-1" src="../src/img/ele.png"><span class="text-gray-700 dark:text-gray-200">Dashpro</span></h2>
</a>
<!-- navbar toggler -->
<div class="end-0 flex layhetgsjdcb">
<!-- Mobile menu button-->
<button id="navbartoggle" type="button" class="inline-flex layhetgsjdcb yhansklopals text-gray-800 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 focus:outline-none focus:ring-0" aria-controls="mobile-menu" @click="open = !open" aria-expanded="false" x-bind:aria-expanded="open.toString()">
<span class="sr-only">Mobile menu</span>
<svg x-description="Icon closed" x-state:on="Menu open" x-state:off="Menu closed" class="block h-8 w-8" :class="{ 'hidden': open, 'block': !(open) }" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
<svg x-description="Icon open" x-state:on="Menu open" x-state:off="Menu closed" class="hidden h-8 w-8" :class="{ 'block': open, 'hidden': !(open) }" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
</div>
<!-- Mobile menu -->
<div class="lg:hidden fixed w-full h-full inset-0 z-50" id="mobile-menu" x-description="Mobile menu" x-show="open" style="display: none;">
<!-- bg open -->
<span class="fixed bg-gray-900 opacity-70 w-full h-full ajsklekajsnm top-0"></span>
<!-- Mobile navbar -->
<nav id="mobile-nav" class="flex ioajsklehsnm end-0 w-64 fixed top-0 py-4 bg-white dark:bg-gray-900 h-full fioplahensmk z-40" x-show="open" @click.away="open=false" x-description="Mobile menu" x-show="open" role="menu" aria-orientation="vertical" aria-labelledby="navbartoggle" x-transition:enter="transform transition-transform duration-300" x-transition:enter-start="translate-x-full" x-transition:enter-end="translate-x-0" x-transition:leave="transform transition-transform duration-300" x-transition:leave-start="translate-x-0" x-transition:leave-end="translate-x-full">
<div class="mb-auto">
<!--logo-->
<div class="text-center px-12 mb-8">
<a href="#" class="flex relative">
<h2 class="text-2xl font-semibold text-gray-200 uajskeiolksb max-h-9 flex layhetgsjdcb gap-2"><img class="inline-block w-7 h-auto me-2 -mt-1" src="../src/img/ele.png"><span class="text-gray-700 dark:text-gray-200">Dashpro</span></h2>
</a>
</div>
<!--navigation-->
<div class="mb-4">
<nav class="relative flex flex-wrap layhetgsjdcb vlaoethsnkma">
<ul id="side-menu" class="w-full float-none flex ioajsklehsnm">
<li class="relative">
<a href="#" class="block py-2.5 uajskeiolksb hover:text-indigo-700 focus:text-indigo-700">Home</a>
</li>
<!-- Insert dropdown mobile Offcanvas menu -->
<li class="relative">
<a href="#" class="block py-2.5 uajskeiolksb hover:text-indigo-700 focus:text-indigo-700">About</a>
</li>
<li class="relative">
<a href="#" class="block py-2.5 uajskeiolksb hover:text-indigo-700 focus:text-indigo-700">Services</a>
</li>
<li class="relative">
<a href="#" class="block py-2.5 uajskeiolksb hover:text-indigo-700 focus:text-indigo-700">Support</a>
</li>
</ul>
</nav>
</div>
</div>
<!-- copyright -->
<div class="mt-5 text-center">
<p>Copyright <a href="#">Dashpro</a> - All right reserved</p>
</div>
</nav>
</div><!-- End Mobile menu -->
<!-- desktop menu -->
<div class="hidden lg:flex lg:klsuaonrmcha lg:flex-nowrap lg:layhetgsjdcb lg:vlaoethsnkma lg:mt-0" id="desktp-menu">
<!-- logo -->
<a class="hidden lg:flex layhetgsjdcb py-2 me-4 text-xl" href="#">
<h2 class="text-2xl font-semibold text-gray-200 uajskeiolksb max-h-9 mklausjenrhtm"><img class="inline-block w-7 h-auto me-2 -mt-1" src="../src/img/ele.png"><span class="text-gray-700 dark:text-gray-200">Dashpro</span></h2>
</a>
<!-- menu -->
<ul class="flex ioajsklehsnm lg:mx-auto mt-2 lg:klsuaonrmcha lg:mt-0">
<li class="relative">
<!-- active -->
<a class="group block py-3 lg:py-7 dkslaoeyhnmj text-indigo-500 hover:text-indigo-600 focus:text-indigo-600" href="#">
<span class="absolute bottom-4 start-1/2 transition-transform ltr:-translate-x-1/2 rtl:translate-x-1/2 w-6 h-0.5 bg-indigo-600 duration-700 ease-in-out opacity-100"></span>
Home
</a>
</li>
<!-- Insert desktop dropdown menu -->
<li class="relative">
<a class="group block py-3 lg:py-7 dkslaoeyhnmj hover:text-indigo-700 focus:text-indigo-700" href="#">
<span class="absolute bottom-4 start-1/2 transition-transform ltr:-translate-x-1/2 rtl:translate-x-1/2 w-6 h-0.5 bg-indigo-700 duration-700 ease-in-out opacity-0 group-hover:opacity-100"></span>
About
</a>
</li>
<li class="relative">
<a class="group block py-3 lg:py-7 dkslaoeyhnmj hover:text-indigo-700 focus:text-indigo-700" href="#">
<span class="absolute bottom-4 start-1/2 transition-transform ltr:-translate-x-1/2 rtl:translate-x-1/2 w-6 h-0.5 bg-indigo-700 duration-700 ease-in-out opacity-0 group-hover:opacity-100"></span>
Services
</a>
</li>
<li class="relative">
<a class="group block py-3 lg:py-7 dkslaoeyhnmj hover:text-indigo-700 focus:text-indigo-700" href="#">
<span class="absolute bottom-4 start-1/2 transition-transform ltr:-translate-x-1/2 rtl:translate-x-1/2 w-6 h-0.5 bg-indigo-700 duration-700 ease-in-out opacity-0 group-hover:opacity-100"></span>
Support
</a>
</li>
</ul>
<!-- button -->
<div class="grid text-center lg:block my-4 lg:my-auto">
<a class="py-2 uajskeiolksb text-sm inline-block text-center rounded leading-5 text-gray-100 bg-purple-500 border border-purple-500 hover:text-white hover:bg-purple-600 hover:ring-0 hover:border-purple-600 focus:bg-purple-600 focus:border-purple-600 focus:outline-none focus:ring-0" target="_blank" rel="noopener" href="#">
<svg xmlns="http://www.w3.org/2000/svg" class="inline me-1" width="1.2rem" height="1.2rem" fill="currentColor" viewBox="0 0 512 512"><circle cx="176" cy="416" r="16" style="fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><circle cx="400" cy="416" r="16" style="fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><polyline points="48 80 112 80 160 352 416 352" style="fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M160,288H409.44a8,8,0,0,0,7.85-6.43l28.8-144a8,8,0,0,0-7.85-9.57H128" style="fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg> Buy Now
</a>
</div>
</div><!-- end desktop menu -->
</div>
</nav><!-- End Navbar -->
Navbar Dropdown
<!-- Navbar -->
<nav x-data="{ open: false }" class="flex flex-nowrap lg:flex-start layhetgsjdcb z-50 top-0 start-0 end-0 bg-white dark:bg-gray-800 overflow-y-auto max-h-screen lg:overflow-visible lg:max-h-full">
<div class="container mx-auto uajskeiolksb xl:max-w-6xl ">
<!-- mobile navigation -->
<div class="flex klsuaonrmcha vlaoethsnkma py-3 lg:hidden">
<!-- logo -->
<a class="flex layhetgsjdcb py-2 me-4 text-xl" href="#">
<h2 class="text-2xl font-semibold text-gray-200 uajskeiolksb max-h-9 mklausjenrhtm"><img class="inline-block w-7 h-auto me-2 -mt-1" src="../src/img/ele.png"><span class="text-gray-700 dark:text-gray-200">Dashpro</span></h2>
</a>
<!-- navbar toggler -->
<div class="end-0 flex layhetgsjdcb">
<!-- Mobile menu button-->
<button type="button" class="inline-flex layhetgsjdcb yhansklopals text-gray-800 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 focus:outline-none focus:ring-0" aria-controls="mobile-menu" @click="open = !open" aria-expanded="false" x-bind:aria-expanded="open.toString()">
<span class="sr-only">Mobile menu</span>
<svg x-description="Icon closed" x-state:on="Menu open" x-state:off="Menu closed" class="block h-8 w-8" :class="{ 'hidden': open, 'block': !(open) }" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
<svg x-description="Icon open" x-state:on="Menu open" x-state:off="Menu closed" class="hidden h-8 w-8" :class="{ 'block': open, 'hidden': !(open) }" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
</div>
<!-- mobile menu -->
<div class="flex ioajsklehsnm lg:hidden" id="mobile-menu" x-description="Mobile menu" x-show="open" style="display: none;">
<!-- menu -->
<ul class="flex ioajsklehsnm mt-2">
<li class="relative">
<!-- active -->
<a class="group block py-3 lg:py-7 px-0 text-indigo-500 hover:text-indigo-600 focus:text-indigo-600" href="#">
<span class="absolute bottom-4 start-1/2 transition-transform ltr:-translate-x-1/2 rtl:translate-x-1/2 w-6 h-0.5 bg-indigo-600 duration-700 ease-in-out opacity-100"></span>
Home
</a>
</li>
<!-- Insert dropdown mobile menu -->
<li class="relative">
<a class="group block py-3 lg:py-7 px-0 hover:text-indigo-600 focus:text-indigo-600" href="#">
<span class="absolute bottom-4 start-1/2 transition-transform ltr:-translate-x-1/2 rtl:translate-x-1/2 w-6 h-0.5 bg-indigo-600 duration-700 ease-in-out opacity-0 group-hover:opacity-100"></span>
About
</a>
</li>
<li class="relative">
<a class="group block py-3 lg:py-7 px-0 hover:text-indigo-600 focus:text-indigo-600" href="#">
<span class="absolute bottom-4 start-1/2 transition-transform ltr:-translate-x-1/2 rtl:translate-x-1/2 w-6 h-0.5 bg-indigo-600 duration-700 ease-in-out opacity-0 group-hover:opacity-100"></span>
Services
</a>
</li>
<li class="relative">
<a class="group block py-3 lg:py-7 px-0 hover:text-indigo-600 focus:text-indigo-600" href="#">
<span class="absolute bottom-4 start-1/2 transition-transform ltr:-translate-x-1/2 rtl:translate-x-1/2 w-6 h-0.5 bg-indigo-600 duration-700 ease-in-out opacity-0 group-hover:opacity-100"></span>
Contact
</a>
</li>
</ul>
<!-- button -->
<div class="grid text-center my-4">
<a class="py-2 uajskeiolksb -ms-1 rounded leading-5 text-sm text-gray-100 bg-purple-500 border border-purple-500 hover:text-white hover:bg-purple-600 hover:ring-0 hover:border-purple-600 focus:bg-purple-600 focus:border-purple-600 focus:outline-none focus:ring-0" target="_blank" rel="noopener" href="#">
<svg xmlns="http://www.w3.org/2000/svg" class="inline me-1" width="1.2rem" height="1.2rem" fill="currentColor" viewBox="0 0 512 512"><circle cx="176" cy="416" r="16" style="fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><circle cx="400" cy="416" r="16" style="fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><polyline points="48 80 112 80 160 352 416 352" style="fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M160,288H409.44a8,8,0,0,0,7.85-6.43l28.8-144a8,8,0,0,0-7.85-9.57H128" style="fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg> Buy Now
</a>
</div>
</div><!-- end mobile menu -->
<!-- desktop menu -->
<div class="hidden lg:flex lg:klsuaonrmcha lg:flex-nowrap lg:layhetgsjdcb lg:vlaoethsnkma lg:mt-0" id="desktp-menu">
<!-- logo -->
<a class="hidden lg:flex layhetgsjdcb py-2 me-4 text-xl" href="#">
<h2 class="text-2xl font-semibold text-gray-200 uajskeiolksb max-h-9 mklausjenrhtm"><img class="inline-block w-7 h-auto me-2 -mt-1" src="../src/img/ele.png"><span class="text-gray-700 dark:text-gray-200">Dashpro</span></h2>
</a>
<!-- menu -->
<ul class="flex ioajsklehsnm lg:mx-auto mt-2 lg:klsuaonrmcha lg:mt-0">
<li class="relative">
<!-- active -->
<a class="group block py-3 lg:py-7 dkslaoeyhnmj text-indigo-500 hover:text-indigo-600 focus:text-indigo-600" href="#">
<span class="absolute bottom-4 start-1/2 transition-transform ltr:-translate-x-1/2 rtl:translate-x-1/2 w-6 h-0.5 bg-indigo-600 duration-700 ease-in-out opacity-100"></span>
Home
</a>
</li>
<!-- Insert desktop dropdown menu -->
<li class="relative">
<a class="group block py-3 lg:py-7 dkslaoeyhnmj hover:text-indigo-600 focus:text-indigo-600" href="#">
<span class="absolute bottom-4 start-1/2 transition-transform ltr:-translate-x-1/2 rtl:translate-x-1/2 w-6 h-0.5 bg-indigo-600 duration-700 ease-in-out opacity-0 group-hover:opacity-100"></span>
About
</a>
</li>
<li class="relative">
<a class="group block py-3 lg:py-7 dkslaoeyhnmj hover:text-indigo-600 focus:text-indigo-600" href="#">
<span class="absolute bottom-4 start-1/2 transition-transform ltr:-translate-x-1/2 rtl:translate-x-1/2 w-6 h-0.5 bg-indigo-600 duration-700 ease-in-out opacity-0 group-hover:opacity-100"></span>
Services
</a>
</li>
</ul>
<!-- button -->
<div class="grid text-center lg:block my-4 lg:my-auto">
<a class="py-2 uajskeiolksb -ms-1 rounded leading-5 text-sm text-gray-100 bg-purple-500 border border-purple-500 hover:text-white hover:bg-purple-600 hover:ring-0 hover:border-purple-600 focus:bg-purple-600 focus:border-purple-600 focus:outline-none focus:ring-0" target="_blank" rel="noopener" href="#">
<svg xmlns="http://www.w3.org/2000/svg" class="inline me-1" width="1.2rem" height="1.2rem" fill="currentColor" viewBox="0 0 512 512"><circle cx="176" cy="416" r="16" style="fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><circle cx="400" cy="416" r="16" style="fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><polyline points="48 80 112 80 160 352 416 352" style="fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M160,288H409.44a8,8,0,0,0,7.85-6.43l28.8-144a8,8,0,0,0-7.85-9.57H128" style="fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg> Buy Now
</a>
</div>
</div><!-- end desktop menu -->
</div>
</nav><!-- End Navbar -->
If you want to use navbar fixed, please add fixed
class in flex flex-nowrap lg:flex-start
(navbar parent)
Don't forget to add padding top 20 in body
like this <body class="pt-20 font-sans text-base font-normal text-gray-700">