Sticky Navigation Component
A responsive sticky navigation bar that follows Material Design guidelines, featuring a dark mode.
HTML Code
<header class="bg-white dark:bg-gray-800 shadow fixed top-0 left-0 right-0 z-50 transition-all duration-300">
<div class="container mx-auto p-4 flex justify-between items-center">
<div class="flex items-center">
<img src="https://picsum.photos/50/50" alt="Logo" class="h-10 w-10 rounded-full">
<h1 class="ml-2 text-xl font-semibold text-gray-800 dark:text-white">MyWebsite</h1>
</div>
<nav>
<ul class="flex space-x-4">
<li><a href="#" class="text-gray-800 dark:text-gray-200 hover:text-blue-500 dark:hover:text-blue-400 transition-colors duration-200">Home</a></li>
<li><a href="#" class="text-gray-800 dark:text-gray-200 hover:text-blue-500 dark:hover:text-blue-400 transition-colors duration-200">About</a></li>
<li><a href="#" class="text-gray-800 dark:text-gray-200 hover:text-blue-500 dark:hover:text-blue-400 transition-colors duration-200">Services</a></li>
<li><a href="#" class="text-gray-800 dark:text-gray-200 hover:text-blue-500 dark:hover:text-blue-400 transition-colors duration-200">Contact</a></li>
</ul>
</nav>
</div>
</header>
<main class="pt-16 bg-gray-100 dark:bg-gray-900">
<section class="container mx-auto py-10">
<h2 class="text-2xl font-bold text-gray-800 dark:text-white mb-6">Welcome to MyWebsite</h2>
<p class="text-gray-700 dark:text-gray-300">This is a simple sticky navigation component built with Tailwind CSS. Scroll down to see the sticky effect in action.</p>
<div class="mt-10 space-y-4">
<div class="h-64 bg-gray-300 dark:bg-gray-700 rounded shadow">Placeholder for Content</div>
<div class="h-64 bg-gray-300 dark:bg-gray-700 rounded shadow">Placeholder for Content</div>
<div class="h-64 bg-gray-300 dark:bg-gray-700 rounded shadow">Placeholder for Content</div>
</div>
</section>
</main>
Related Components
Sticky Navigation Component
A sticky navigation component for e-commerce, featuring a minimalist/flat design with vibrant colors. It includes a logo, search bar, cart icon, and user avatar, all styled with Tailwind CSS for responsiveness and dark theme support.
Sticky Navigation Component
A responsive sticky navigation component styled with Material Design principles using Tailwind CSS, featuring a dark theme and including random placeholder images and avatar.
Sticky Navigation Component
A responsive sticky navigation bar designed with microinteractions and a triadic color scheme, suitable for blogs and content consumption.