Skip to content

Instantly share code, notes, and snippets.

@nauman
Last active October 11, 2021 11:32
Show Gist options
  • Save nauman/e9fa80990a6a3c36e46bfd239cb8f01a to your computer and use it in GitHub Desktop.
Save nauman/e9fa80990a6a3c36e46bfd239cb8f01a to your computer and use it in GitHub Desktop.
Tailwind navbar 1
<header class="w-full">
<nav class="relative px-5 md:px-8 border-2 border-indigo-600">
<div>
<div class="flex justify-between items-center py-8 xl:justify-start xl:space-x-10">
<div class="branding">
<a href="#" class="flex">
<span class="sr-only">Product</span>
</a>
<a href="/">Product</a>
</div>
<div class="xl:flex-1 xl:flex xl:items-center xl:justify-end">
<nav class="flex space-x-8 items-center">
<% if user_signed_in? %>
<strong><%= current_user.email %></strong>
<%= link_to 'Porfile', edit_user_registration_path, class: 'navbar-link' %>
<%= button_to "Logout", destroy_user_session_path, method: :delete, class: 'cursor-pointer navbar-link bg-transparent' %>
<% else %>
<%= link_to "Login", new_user_session_path, :class => 'navbar-link' %>
<%= link_to "Register", new_user_registration_path, :class => 'navbar-link btn flex flex-row w-auto justify-between items-center btn-primary' %>
<% end %>
</nav>
</div>
</div>
</div>
</nav>
</header>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment