Toggle navigation
☰
HTML
CSS
Scripting
Database
<!doctype html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Tailwind CSS Button Group</title> <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4.2.1"></script> </head> <body class="bg-gray-50 flex items-center justify-center min-h-screen" x-data="{ active: 'yearly' }"> <div class="inline-flex rounded-2xl shadow-2xl shadow-indigo-100 overflow-hidden border-2 border-slate-100 bg-white"> <button @click="active = 'monthly'" :class="active === 'monthly' ? 'bg-indigo-600 text-white' : 'bg-white text-slate-800 hover:bg-slate-50'" class="px-8 py-4 text-xs font-black uppercase tracking-widest transition-all border-r-2 border-slate-100 cursor-pointer" > Monthly </button> <button @click="active = 'yearly'" :class="active === 'yearly' ? 'bg-indigo-600 text-white' : 'bg-white text-slate-800 hover:bg-slate-50'" class="px-8 py-4 text-xs font-black uppercase tracking-widest transition-all border-r-2 border-slate-100 cursor-pointer" > Yearly </button> <button @click="active = 'lifetime'" :class="active === 'lifetime' ? 'bg-indigo-600 text-white' : 'bg-white text-slate-800 hover:bg-slate-50'" class="px-8 py-4 text-xs font-black uppercase tracking-widest transition-all cursor-pointer" > Lifetime </button> </div> <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script> </body> </html>