Header Components

Tailwind CSS Header

# Intro Actions

Welcome Back, Barry!

Let's write a new blog post! 🎉

Code

1<header>
2  <div class="mx-auto max-w-screen px-4 py-8 sm:px-6 sm:py-12 lg:px-8">
3    <div class="sm:flex sm:items-center sm:justify-between">
4      <div class="text-center sm:text-left">
5        <h1 class="text-2xl font-bold text-gray-900 sm:text-3xl">Welcome Back, Barry!</h1>
6
7        <p class="mt-1.5 text-sm text-gray-500">Let's write a new blog post! 🎉</p>
8      </div>
9
10      <div class="mt-4 flex flex-col gap-4 sm:mt-0 sm:flex-row sm:items-center">
11        <button
12          class="inline-flex items-center justify-center gap-1.5 rounded-lg border border-gray-200 px-5 py-3 text-gray-500 transition hover:bg-gray-50 hover:text-gray-700 focus:outline-none focus:ring"
13          type="button"
14        >
15          <span class="text-sm font-medium"> View Website </span>
16
17          <svg
18            xmlns="http://www.w3.org/2000/svg"
19            class="h-4 w-4"
20            fill="none"
21            viewBox="0 0 24 24"
22            stroke="currentColor"
23            stroke-width="2"
24          >
25            <path
26              stroke-linecap="round"
27              stroke-linejoin="round"
28              d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
29            />
30          </svg>
31        </button>
32
33        <button
34          class="block rounded-lg bg-indigo-600 px-5 py-3 text-sm font-medium text-white transition hover:bg-indigo-700 focus:outline-none focus:ring"
35          type="button"
36        >
37          Create Post
38        </button>
39      </div>
40    </div>
41  </div>
42</header>

# Intro Actions with Background

Welcome Back, Barry!

Let's write a new blog post! 🎉

Code

1<header class="bg-gray-100">
2  <div class="mx-auto max-w-screen px-4 py-8 sm:px-6 sm:py-12 lg:px-8">
3    <div class="sm:flex sm:items-center sm:justify-between">
4      <div class="text-center sm:text-left">
5        <h1 class="text-2xl font-bold text-gray-900 sm:text-3xl">Welcome Back, Barry!</h1>
6
7        <p class="mt-1.5 text-sm text-gray-500">Let's write a new blog post! 🎉</p>
8      </div>
9
10      <div class="mt-4 flex flex-col gap-4 sm:mt-0 sm:flex-row sm:items-center">
11        <button
12          class="inline-flex items-center justify-center gap-1.5 rounded-lg border border-gray-200 bg-white px-5 py-3 text-gray-500 transition hover:text-gray-700 focus:outline-none focus:ring"
13          type="button"
14        >
15          <span class="text-sm font-medium"> View Website </span>
16
17          <svg
18            xmlns="http://www.w3.org/2000/svg"
19            class="h-4 w-4"
20            fill="none"
21            viewBox="0 0 24 24"
22            stroke="currentColor"
23            stroke-width="2"
24          >
25            <path
26              stroke-linecap="round"
27              stroke-linejoin="round"
28              d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
29            />
30          </svg>
31        </button>
32
33        <button
34          class="block rounded-lg bg-indigo-600 px-5 py-3 text-sm font-medium text-white transition hover:bg-indigo-700 focus:outline-none focus:ring"
35          type="button"
36        >
37          Create Post
38        </button>
39      </div>
40    </div>
41  </div>
42</header>

# Intro with Search and Mini Navigation

Welcome Back, Barry!

Your website has seen a 52% increase in traffic in the last month. Keep it up! 🚀

Code

1<header class="bg-gray-50">
2        <div class="mx-auto max-w-screen px-4 py-8 sm:px-6 lg:px-8">
3          <div class="flex items-center justify-end gap-4">
4            <div class="flex items-center gap-4">
5              <div class="relative">
6                <label class="sr-only" for="search"> Search </label>
7      
8                <input
9                  class="h-10 w-full rounded-full border-none bg-white pe-10 ps-4 text-sm shadow-sm sm:w-56"
10                  id="search"
11                  type="search"
12                  placeholder="Search website..."
13                />
14      
15                <button
16                  type="button"
17                  class="absolute end-1 top-1/2 -translate-y-1/2 rounded-full bg-gray-50 p-2 text-gray-600 transition hover:text-gray-700"
18                >
19                  <span class="sr-only">Search</span>
20                  <svg
21                    xmlns="http://www.w3.org/2000/svg"
22                    class="h-4 w-4"
23                    fill="none"
24                    viewBox="0 0 24 24"
25                    stroke="currentColor"
26                    stroke-width="2"
27                  >
28                    <path
29                      stroke-linecap="round"
30                      stroke-linejoin="round"
31                      d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
32                    />
33                  </svg>
34                </button>
35              </div>
36      
37              <a
38                href="#"
39                class="block shrink-0 rounded-full bg-white p-2.5 text-gray-600 shadow-sm hover:text-gray-700"
40              >
41                <span class="sr-only">Notifications</span>
42                <svg
43                  xmlns="http://www.w3.org/2000/svg"
44                  class="h-5 w-5"
45                  fill="none"
46                  viewBox="0 0 24 24"
47                  stroke="currentColor"
48                  stroke-width="2"
49                >
50                  <path
51                    stroke-linecap="round"
52                    stroke-linejoin="round"
53                    d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"
54                  />
55                </svg>
56              </a>
57            </div>
58      
59            <span aria-hidden="true" class="block h-6 w-px rounded-full bg-gray-200"></span>
60      
61            <a href="#" class="block shrink-0">
62              <span class="sr-only">Profile</span>
63              <img
64                alt="Man"
65                src="https://images.unsplash.com/photo-1600486913747-55e5470d6f40?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1770&q=80"
66                class="h-10 w-10 rounded-full object-cover"
67              />
68            </a>
69          </div>
70      
71          <div class="mt-8">
72            <h1 class="text-2xl font-bold text-gray-900 sm:text-3xl">Welcome Back, Barry!</h1>
73      
74            <p class="mt-1.5 text-sm text-gray-500">
75              Your website has seen a 52% increase in traffic in the last month. Keep it up! 🚀
76            </p>
77          </div>
78        </div>
79      </header>

# Intro with Justified Search and Mini Navigation

Welcome Back, Barry!

Your website has seen a 52% increase in traffic in the last month. Keep it up! 🚀

Code

1<header class="bg-gray-50">
2        <div class="mx-auto max-w-screen px-4 py-8 sm:px-6 lg:px-8">
3          <div class="flex items-center sm:justify-between sm:gap-4">
4            <div class="relative hidden sm:block">
5              <label class="sr-only" for="search"> Search </label>
6      
7              <input
8                class="h-10 w-full rounded-lg border-none bg-white pe-10 ps-4 text-sm shadow-sm sm:w-56"
9                id="search"
10                type="search"
11                placeholder="Search website..."
12              />
13      
14              <button
15                type="button"
16                class="absolute end-1 top-1/2 -translate-y-1/2 rounded-md bg-gray-50 p-2 text-gray-600 transition hover:text-gray-700"
17              >
18                <span class="sr-only">Search</span>
19                <svg
20                  xmlns="http://www.w3.org/2000/svg"
21                  class="h-4 w-4"
22                  fill="none"
23                  viewBox="0 0 24 24"
24                  stroke="currentColor"
25                  stroke-width="2"
26                >
27                  <path
28                    stroke-linecap="round"
29                    stroke-linejoin="round"
30                    d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
31                  />
32                </svg>
33              </button>
34            </div>
35      
36            <div class="flex flex-1 items-center justify-between gap-8 sm:justify-end">
37              <div class="flex gap-4">
38                <button
39                  type="button"
40                  class="block shrink-0 rounded-lg bg-white p-2.5 text-gray-600 shadow-sm hover:text-gray-700 sm:hidden"
41                >
42                  <span class="sr-only">Search</span>
43                  <svg
44                    xmlns="http://www.w3.org/2000/svg"
45                    class="h-5 w-5"
46                    fill="none"
47                    viewBox="0 0 24 24"
48                    stroke="currentColor"
49                    stroke-width="2"
50                  >
51                    <path
52                      stroke-linecap="round"
53                      stroke-linejoin="round"
54                      d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
55                    />
56                  </svg>
57                </button>
58      
59                <a
60                  href="#"
61                  class="block shrink-0 rounded-lg bg-white p-2.5 text-gray-600 shadow-sm hover:text-gray-700"
62                >
63                  <span class="sr-only">Academy</span>
64                  <svg
65                    xmlns="http://www.w3.org/2000/svg"
66                    class="h-5 w-5"
67                    fill="none"
68                    viewBox="0 0 24 24"
69                    stroke="currentColor"
70                    stroke-width="2"
71                  >
72                    <path d="M12 14l9-5-9-5-9 5 9 5z" />
73                    <path
74                      d="M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z"
75                    />
76                    <path
77                      stroke-linecap="round"
78                      stroke-linejoin="round"
79                      d="M12 14l9-5-9-5-9 5 9 5zm0 0l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14zm-4 6v-7.5l4-2.222"
80                    />
81                  </svg>
82                </a>
83      
84                <a
85                  href="#"
86                  class="block shrink-0 rounded-lg bg-white p-2.5 text-gray-600 shadow-sm hover:text-gray-700"
87                >
88                  <span class="sr-only">Notifications</span>
89                  <svg
90                    xmlns="http://www.w3.org/2000/svg"
91                    class="h-5 w-5"
92                    fill="none"
93                    viewBox="0 0 24 24"
94                    stroke="currentColor"
95                    stroke-width="2"
96                  >
97                    <path
98                      stroke-linecap="round"
99                      stroke-linejoin="round"
100                      d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"
101                    />
102                  </svg>
103                </a>
104              </div>
105      
106              <button type="button" class="group flex shrink-0 items-center rounded-lg transition">
107                <span class="sr-only">Menu</span>
108                <img
109                  alt="Man"
110                  src="https://images.unsplash.com/photo-1600486913747-55e5470d6f40?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1770&q=80"
111                  class="h-10 w-10 rounded-full object-cover"
112                />
113      
114                <p class="ms-2 hidden text-left text-xs sm:block">
115                  <strong class="block font-medium">Eric Frusciante</strong>
116      
117                  <span class="text-gray-500"> eric@frusciante.com </span>
118                </p>
119      
120                <svg
121                  xmlns="http://www.w3.org/2000/svg"
122                  class="ms-4 hidden h-5 w-5 text-gray-500 transition group-hover:text-gray-700 sm:block"
123                  viewBox="0 0 20 20"
124                  fill="currentColor"
125                >
126                  <path
127                    fill-rule="evenodd"
128                    d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
129                    clip-rule="evenodd"
130                  />
131                </svg>
132              </button>
133            </div>
134          </div>
135      
136          <div class="mt-8">
137            <h1 class="text-2xl font-bold text-gray-900 sm:text-3xl">Welcome Back, Barry!</h1>
138      
139            <p class="mt-1.5 text-sm text-gray-500">
140              Your website has seen a 52% increase in traffic in the last month. Keep it up! 🚀
141            </p>
142          </div>
143        </div>
144      </header>

# Left Aligned

Code

1<header class="bg-white">
2  <div class="mx-auto flex h-16 max-w-screen items-center gap-8 px-4 sm:px-6 lg:px-8">
3    <a class="block text-teal-600" href="/">
4      <span class="sr-only">Home</span>
5      <svg class="h-12 w-12 object-contain" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#03a9fc">
6      <g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
7      <g id="SVGRepo_iconCarrier"> 
8      <path d="M12 3V21M9.99995 4L12 6L14 4M9.99995 20L12 18L14 20M4.23218 7.5L19.8206 16.5M4.11133 9.50885L6.57017 8.85L5.91133 6.39115M18.141 17.6089L17.4821 15.15L19.941 14.4912M19.8205 7.5L4.232 16.5M18.1413 6.39115L17.4825 8.85L19.9413 9.50885M4.11166 14.4911L6.57051 15.15L5.91166 17.6088" stroke="#0fafff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
9      </path> </g>
10      </svg>
11    </a>
12
13    <div class="flex flex-1 items-center justify-end md:justify-between">
14      <nav aria-label="Global" class="hidden md:block">
15        <ul class="flex items-center gap-6 text-sm">
16          <li>
17            <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> About </a>
18          </li>
19
20          <li>
21            <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> Careers </a>
22          </li>
23
24          <li>
25            <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> History </a>
26          </li>
27
28          <li>
29            <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> Services </a>
30          </li>
31
32          <li>
33            <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> Projects </a>
34          </li>
35
36          <li>
37            <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> Blog </a>
38          </li>
39        </ul>
40      </nav>
41
42      <div class="flex items-center gap-4">
43        <div class="sm:flex sm:gap-4">
44          <a
45            class="block rounded-md bg-blue-600 px-5 py-2.5 text-sm font-medium text-white transition hover:bg-blue-700"
46            href="/"
47          >
48            Login
49          </a>
50
51          <a
52            class="hidden rounded-md bg-gray-100 px-5 py-2.5 text-sm font-medium text-blue-600 transition hover:text-blue-600/75 sm:block"
53            href="/"
54          >
55            Register
56          </a>
57        </div>
58
59        <button
60          class="block rounded bg-gray-100 p-2.5 text-gray-600 transition hover:text-gray-600/75 md:hidden"
61        >
62          <span class="sr-only">Toggle menu</span>
63          <svg
64            xmlns="http://www.w3.org/2000/svg"
65            class="h-5 w-5"
66            fill="none"
67            viewBox="0 0 24 24"
68            stroke="currentColor"
69            stroke-width="2"
70          >
71            <path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16" />
72          </svg>
73        </button>
74      </div>
75    </div>
76  </div>
77</header>

# Center Aligned

Code

1<header class="bg-white">
2  <div class="mx-auto max-w-screen px-4 sm:px-6 lg:px-8">
3    <div class="flex h-16 items-center justify-between">
4      <div class="md:flex md:items-center md:gap-12">
5        <a class="block text-teal-600" href="/">
6          <span class="sr-only">Home</span>
7          <svg class="h-12 w-12 object-contain" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#03a9fc">
8      <g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
9      <g id="SVGRepo_iconCarrier"> 
10      <path d="M12 3V21M9.99995 4L12 6L14 4M9.99995 20L12 18L14 20M4.23218 7.5L19.8206 16.5M4.11133 9.50885L6.57017 8.85L5.91133 6.39115M18.141 17.6089L17.4821 15.15L19.941 14.4912M19.8205 7.5L4.232 16.5M18.1413 6.39115L17.4825 8.85L19.9413 9.50885M4.11166 14.4911L6.57051 15.15L5.91166 17.6088" stroke="#0fafff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
11      </path> </g>
12      </svg>
13        </a>
14      </div>
15
16      <div class="hidden md:block">
17        <nav aria-label="Global">
18          <ul class="flex items-center gap-6 text-sm">
19            <li>
20              <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> About </a>
21            </li>
22
23            <li>
24              <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> Careers </a>
25            </li>
26
27            <li>
28              <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> History </a>
29            </li>
30
31            <li>
32              <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> Services </a>
33            </li>
34
35            <li>
36              <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> Projects </a>
37            </li>
38
39            <li>
40              <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> Blog </a>
41            </li>
42          </ul>
43        </nav>
44      </div>
45
46      <div class="flex items-center gap-4">
47        <div class="sm:flex sm:gap-4">
48          <a
49            class="rounded-md bg-blue-600 px-5 py-2.5 text-sm font-medium text-white shadow"
50            href="/"
51          >
52            Login
53          </a>
54
55          <div class="hidden sm:flex">
56            <a
57              class="rounded-md bg-gray-100 px-5 py-2.5 text-sm font-medium text-blue-600"
58              href="/"
59            >
60              Register
61            </a>
62          </div>
63        </div>
64
65        <div class="block md:hidden">
66          <button class="rounded bg-gray-100 p-2 text-gray-600 transition hover:text-gray-600/75">
67            <svg
68              xmlns="http://www.w3.org/2000/svg"
69              class="h-5 w-5"
70              fill="none"
71              viewBox="0 0 24 24"
72              stroke="currentColor"
73              stroke-width="2"
74            >
75              <path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16" />
76            </svg>
77          </button>
78        </div>
79      </div>
80    </div>
81  </div>
82</header>

# Right Aligned

Code

1<header class="bg-white">
2  <div class="mx-auto max-w-screen px-4 sm:px-6 lg:px-8">
3    <div class="flex h-16 items-center justify-between">
4      <div class="flex-1 md:flex md:items-center md:gap-12">
5        <a class="block text-teal-600" href="/">
6          <span class="sr-only">Home</span>
7          <svg class="h-12 w-12 object-contain" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#03a9fc">
8      <g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
9      <g id="SVGRepo_iconCarrier"> 
10      <path d="M12 3V21M9.99995 4L12 6L14 4M9.99995 20L12 18L14 20M4.23218 7.5L19.8206 16.5M4.11133 9.50885L6.57017 8.85L5.91133 6.39115M18.141 17.6089L17.4821 15.15L19.941 14.4912M19.8205 7.5L4.232 16.5M18.1413 6.39115L17.4825 8.85L19.9413 9.50885M4.11166 14.4911L6.57051 15.15L5.91166 17.6088" stroke="#0fafff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
11      </path> </g>
12      </svg>
13        </a>
14      </div>
15
16      <div class="md:flex md:items-center md:gap-12">
17        <nav aria-label="Global" class="hidden md:block">
18          <ul class="flex items-center gap-6 text-sm">
19            <li>
20              <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> About </a>
21            </li>
22
23            <li>
24              <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> Careers </a>
25            </li>
26
27            <li>
28              <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> History </a>
29            </li>
30
31            <li>
32              <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> Services </a>
33            </li>
34
35            <li>
36              <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> Projects </a>
37            </li>
38
39            <li>
40              <a class="text-gray-500 transition hover:text-gray-500/75" href="/"> Blog </a>
41            </li>
42          </ul>
43        </nav>
44
45        <div class="flex items-center gap-4">
46          <div class="sm:flex sm:gap-4">
47            <a
48              class="rounded-md bg-blue-600 px-5 py-2.5 text-sm font-medium text-white shadow"
49              href="/"
50            >
51              Login
52            </a>
53
54            <div class="hidden sm:flex">
55              <a
56                class="rounded-md bg-gray-100 px-5 py-2.5 text-sm font-medium text-blue-600"
57                href="/"
58              >
59                Register
60              </a>
61            </div>
62          </div>
63
64          <div class="block md:hidden">
65            <button class="rounded bg-gray-100 p-2 text-gray-600 transition hover:text-gray-600/75">
66              <svg
67                xmlns="http://www.w3.org/2000/svg"
68                class="h-5 w-5"
69                fill="none"
70                viewBox="0 0 24 24"
71                stroke="currentColor"
72                stroke-width="2"
73              >
74                <path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16" />
75              </svg>
76            </button>
77          </div>
78        </div>
79      </div>
80    </div>
81  </div>
82</header>

# Navbar with search

Code

1<nav class="bg-white border-gray-200 ">
2<div class="max-w-screen flex flex-wrap items-center justify-between mx-auto p-4">
3<a href="#" class="flex items-center space-x-3 rtl:space-x-reverse">
4<svg class="h-12 w-12 object-contain" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#03a9fc">
5<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
6<g id="SVGRepo_iconCarrier"> 
7<path d="M12 3V21M9.99995 4L12 6L14 4M9.99995 20L12 18L14 20M4.23218 7.5L19.8206 16.5M4.11133 9.50885L6.57017 8.85L5.91133 6.39115M18.141 17.6089L17.4821 15.15L19.941 14.4912M19.8205 7.5L4.232 16.5M18.1413 6.39115L17.4825 8.85L19.9413 9.50885M4.11166 14.4911L6.57051 15.15L5.91166 17.6088" stroke="#0fafff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
8</path> </g>
9</svg>
10    <span class="self-center text-2xl font-semibold whitespace-nowrap ">Uiforge</span>
11</a>
12<div class="flex md:order-2">
13  <button type="button" data-collapse-toggle="navbar-search" aria-controls="navbar-search" aria-expanded="false" class="md:hidden text-gray-500  hover:bg-gray-100  focus:outline-none focus:ring-4 focus:ring-gray-200  rounded-lg text-sm p-2.5 me-1">
14    <svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
15      <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
16    </svg>
17    <span class="sr-only">Search</span>
18  </button>
19  <div class="relative hidden md:block">
20    <div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
21      <svg class="w-4 h-4 text-gray-500 " aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
22        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
23      </svg>
24      <span class="sr-only">Search icon</span>
25    </div>
26    <input type="text" id="search-navbar" class="block w-full p-2 ps-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:focus:border-blue-500" placeholder="Search...">
27  </div>
28  <button data-collapse-toggle="navbar-search" type="button" class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 " aria-controls="navbar-search" aria-expanded="false">
29      <span class="sr-only">Open main menu</span>
30      <svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 17 14">
31          <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 1h15M1 7h15M1 13h15"/>
32      </svg>
33  </button>
34</div>
35  <div class="items-center justify-between hidden w-full md:flex md:w-auto md:order-1" id="navbar-search">
36    <div class="relative mt-3 md:hidden">
37      <div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
38        <svg class="w-4 h-4 text-gray-500 " aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
39          <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
40        </svg>
41      </div>
42      <input type="text" id="search-navbar" class="block w-full p-2 ps-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500  " placeholder="Search...">
43    </div>
44    <ul class="flex flex-col p-4 md:p-0 mt-4 font-medium border border-gray-100 rounded-lg bg-gray-50 md:space-x-8 rtl:space-x-reverse md:flex-row md:mt-0 md:border-0 md:bg-white ">
45      <li>
46        <a href="#" class="block py-2 px-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 " aria-current="page">Home</a>
47      </li>
48      <li>
49        <a href="#" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 ">About</a>
50      </li>
51      <li>
52        <a href="#" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 ">Services</a>
53      </li>
54    </ul>
55  </div>
56</div>
57</nav>

# Navbar with submenu

Code

1<nav class="bg-gray-100 border-gray-200 ">
2<div class="flex flex-wrap justify-between items-center mx-auto max-w-screen p-4">
3    <a href="#" class="flex items-center space-x-3 rtl:space-x-reverse">
4    <svg class="h-12 w-12 object-contain" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#03a9fc">
5    <g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
6    <g id="SVGRepo_iconCarrier"> 
7    <path d="M12 3V21M9.99995 4L12 6L14 4M9.99995 20L12 18L14 20M4.23218 7.5L19.8206 16.5M4.11133 9.50885L6.57017 8.85L5.91133 6.39115M18.141 17.6089L17.4821 15.15L19.941 14.4912M19.8205 7.5L4.232 16.5M18.1413 6.39115L17.4825 8.85L19.9413 9.50885M4.11166 14.4911L6.57051 15.15L5.91166 17.6088" stroke="#0fafff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
8    </path> </g>
9    </svg>
10        <span class="self-center text-2xl font-semibold whitespace-nowrap ">Uiforge</span>
11    </a>
12    <div class="flex items-center space-x-6 rtl:space-x-reverse">
13        <a href="tel:5541251234" class="text-sm  text-gray-500  hover:underline">(696) 122-1234</a>
14        <a href="#" class="text-sm  text-blue-600  hover:underline">Login</a>
15    </div>
16</div>
17</nav>
18<nav class="bg-gray-200">
19<div class="max-w-screen px-4 py-3 mx-auto">
20    <div class="flex items-center">
21        <ul class="flex flex-row font-medium mt-0 space-x-8 rtl:space-x-reverse text-sm">
22            <li>
23                <a href="#" class="text-gray-900  hover:underline" aria-current="page">Home</a>
24            </li>
25            <li>
26                <a href="#" class="text-gray-900  hover:underline">Company</a>
27            </li>
28            <li>
29                <a href="#" class="text-gray-900  hover:underline">Team</a>
30            </li>
31            <li>
32                <a href="#" class="text-gray-900  hover:underline">Features</a>
33            </li>
34        </ul>
35    </div>
36</div>
37</nav>