Logo hdtoledo
hdtoledo.dev
Módulos_del_Sistema
MÓDULO_TEÓRICO

Flexbox at the Speed of Light

Flexbox Navbar

Starting the Quantum Dashboard

We have assembled our access system. Now we step into the core of the project: The Dashboard.

We will start by laying out the Top Navigation Bar (Topbar) using Tailwind's master Flexbox utilities.


1. Essential Flexbox Utilities

  • flex: Enables display: flex.
  • justify-between: Pushes children to opposite ends.
  • items-center: Perfectly aligns children along the vertical center.
  • gap-4: 16px clean spacing between items.
  • flex-1: Instructs an element (like a search bar) to expand and consume all available space.

2. Complete Topbar Markup

html
<header class="h-18 px-6 bg-slate-900/80 backdrop-blur-md border-b border-slate-800 flex items-center justify-between sticky top-0 z-30"> <!-- 1. Logo & Branding --> <div class="flex items-center gap-3"> <div class="w-9 h-9 rounded-lg bg-gradient-to-tr from-cyan-500 to-fuchsia-500 flex items-center justify-center text-white font-black text-lg shadow-md shadow-cyan-500/20"> Q </div> <span class="text-lg font-bold tracking-wider text-white">QUANTUM<span class="text-cyan-400">OS</span></span> </div> <!-- 2. Expandable Global Search --> <div class="hidden md:flex items-center flex-1 max-w-md mx-8"> <div class="relative w-full"> <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-slate-500">🔍</span> <input type="search" placeholder="Search node, cluster, or ID..." class="w-full pl-10 pr-4 py-2 bg-slate-950/70 border border-slate-800 rounded-xl text-xs text-white placeholder-slate-500 focus:outline-none focus:border-cyan-400 focus:ring-1 focus:ring-cyan-400 transition-all" > </div> </div> <!-- 3. Actions & User Profile --> <div class="flex items-center gap-4"> <!-- Notification Bell with Glowing Badge --> <button class="relative p-2 rounded-xl bg-slate-800/60 text-slate-300 hover:text-cyan-400 hover:bg-slate-800 transition-colors"> 🔔 <span class="absolute -top-1 -right-1 w-4 h-4 bg-fuchsia-500 text-white font-bold text-[10px] rounded-full flex items-center justify-center animate-pulse"> 3 </span> </button> <!-- User Profile Avatar --> <div class="flex items-center gap-3 pl-2 border-l border-slate-800"> <img src="https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=100" class="w-9 h-9 rounded-full object-cover border border-cyan-400/40"> <div class="hidden sm:block text-left"> <p class="text-xs font-bold text-white">Agent Kane</p> <p class="text-[10px] text-cyan-400">Level 4 Clearance</p> </div> </div> </div> </header>