- No data uploaded
- Instant results
Tailwind CSS Navbar for Vue 3 — Glassmorphism
A production-ready glassmorphism navbar: a responsive top navigation bar with a logo, primary links, a sign-in/CTA pair on desktop and a collapsible hamburger menu on mobile. Pick your brand color, toggle dark mode and corner radius — the live preview and the Vue 3 code update instantly in your browser.
Live component editor
<script setup>
import { ref } from 'vue';
const menu = ref(false);
</script>
<template>
<header class="sticky top-0 z-10 bg-white/60 backdrop-blur-xl border border-white/60 shadow-2xl">
<nav class="max-w-6xl mx-auto px-6 py-3 flex items-center justify-between gap-6" aria-label="Main">
<a href="#" class="flex items-center gap-2 text-lg font-bold no-underline text-slate-900">
<span class="inline-flex items-center px-2.5 py-0.5 text-xs font-semibold rounded-full bg-[#4f46e5]/10 text-[#4f46e5]">◆</span> Acme
</a>
<div class="hidden md:flex items-center gap-6">
<a href="#" class="text-sm font-medium no-underline text-slate-700">Product</a>
<a href="#" class="text-sm font-medium no-underline text-slate-700">Solutions</a>
<a href="#" class="text-sm font-medium no-underline text-slate-700">Pricing</a>
<a href="#" class="text-sm font-medium no-underline text-slate-700">Docs</a>
</div>
<div class="hidden md:flex items-center gap-2">
<a href="#" class="inline-flex items-center justify-center px-3 py-2 text-sm font-semibold rounded-lg transition-colors text-slate-700 hover:bg-slate-900/5">Sign in</a>
<a href="#" class="inline-flex items-center justify-center px-4 py-2.5 text-sm font-semibold rounded-lg bg-[#4f46e5] hover:bg-[#433cc3] text-white shadow-sm transition-colors focus:outline-none focus:ring-2 focus:ring-[#4f46e5] focus:ring-offset-2 focus:ring-offset-white">Get started</a>
</div>
<button type="button" class="inline-flex items-center justify-center px-3 py-2 text-sm font-semibold rounded-lg transition-colors text-slate-700 hover:bg-slate-900/5 md:hidden" aria-controls="mobile-menu" aria-label="Toggle menu" @click="menu = !menu">☰</button>
</nav>
<div id="mobile-menu" v-show="menu">
<div class="md:hidden px-6 pb-4 flex flex-col gap-1">
<a href="#" class="inline-flex items-center justify-center px-3 py-2 text-sm font-semibold rounded-lg transition-colors text-slate-700 hover:bg-slate-900/5">Product</a>
<a href="#" class="inline-flex items-center justify-center px-3 py-2 text-sm font-semibold rounded-lg transition-colors text-slate-700 hover:bg-slate-900/5">Solutions</a>
<a href="#" class="inline-flex items-center justify-center px-3 py-2 text-sm font-semibold rounded-lg transition-colors text-slate-700 hover:bg-slate-900/5">Pricing</a>
<a href="#" class="inline-flex items-center justify-center px-3 py-2 text-sm font-semibold rounded-lg transition-colors text-slate-700 hover:bg-slate-900/5">Docs</a>
<a href="#" class="inline-flex items-center justify-center px-4 py-2.5 text-sm font-semibold rounded-lg bg-[#4f46e5] hover:bg-[#433cc3] text-white shadow-sm transition-colors focus:outline-none focus:ring-2 focus:ring-[#4f46e5] focus:ring-offset-2 focus:ring-offset-white mt-2">Get started</a>
</div>
</div>
</header>
</template>
More Tailwind components for Vue 3
All components →- Footer A multi-column site footer with a brand description, three link groups, a newsletter sign-up field and a copyright row
- Hero Section A landing-page hero with an announcement badge, a large headline, supporting copy, primary and secondary calls to action and a row of social-proof stats
- Login Modal A centered sign-in dialog with email and password fields, “remember me”, a forgot-password link and a social sign-in button
- Cookie Consent Banner A GDPR-style cookie banner with equally prominent “Accept all” and “Reject all”, granular analytics/marketing toggles (off by default), stored consent and Google Consent Mode v2 signals
- Feature Grid A marketing section with a centered heading and a responsive grid of six feature cards, each with an icon badge, title and description
- Signup Form A registration card with name, email and password fields, a password hint, a terms-of-service checkbox and a primary call to action
- Pricing Table A three-tier pricing section with a monthly/yearly billing toggle, a highlighted “most popular” plan and feature checklists
- Contact Form A contact card with name, email, a topic selector, a message textarea and a submit button
Install Tailwind CSS for Vue 3
Create a Vue 3 project with Vite, then add Tailwind CSS v3:
npm create vite@latest my-app -- --template vue
cd my-app
npm install
npm install -D tailwindcss@3 postcss autoprefixer
npx tailwindcss init -pSet content: ['./index.html', './src/**/*.{vue,js}'] in tailwind.config.js, and add to src/style.css:
@tailwind base;
@tailwind components;
@tailwind utilities;The brand color is applied with arbitrary values such as bg-[#4f46e5], so no theme configuration is needed.
Use the navbar in Vue 3
<!-- App.vue -->
<script setup>
import Navbar from './Navbar.vue';
</script>
<template>
<Navbar />
</template>Accessibility & customization
Uses a <nav> landmark with aria-label, the menu button exposes aria-controls and aria-label, and links remain real <a> elements so keyboard and screen-reader navigation work without JavaScript.
Every color, radius and dark-mode choice is baked into plain utility classes, so the copied code has no runtime dependency on this site. The glass style relies on backdrop-filter, supported in all current browsers; place it over a colorful background for the best effect.
Compatibility
| Item | Details |
|---|---|
| CSS framework | Tailwind CSS v3.4+ |
| Library | Vue 3 (<script setup>) |
| Interactive state | menu |
| Dark mode | Yes — toggle in the editor |
| Style | Glassmorphism (backdrop blur) |