Tailwind button group

Responsive button group built with Tailwind. Button group wraps a series of buttons together into a single line (navbar) or stack in a vertical column.


Basic example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!-- Small -->
<div class="flex items-center justify-center mb-4">
  <button
    class="text-purple-500 bg-transparent border-l border-t border-b border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-xs px-4 py-2 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    Left
  </button>
  <button
    class="text-purple-500 bg-transparent border border-solid border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-xs px-4 py-2 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    Center
  </button>
  <button
    class="text-purple-500 bg-transparent border-t border-b border-r border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-xs px-4 py-2 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    Right
  </button>
</div>

<!-- Medium -->
<div class="flex items-center justify-center mb-4">
  <button
    class="text-purple-500 bg-transparent border-l border-t border-b border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-sm px-6 py-3 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    Left
  </button>
  <button
    class="text-purple-500 bg-transparent border border-solid border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-sm px-6 py-3 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    Center
  </button>
  <button
    class="text-purple-500 bg-transparent border-t border-b border-r border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-sm px-6 py-3 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    Right
  </button>
</div>

<!-- Large -->
<div class="flex items-center justify-center mb-4">
  <button
    class="text-purple-500 bg-transparent border-l border-t border-b border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-base px-8 py-3 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    Left
  </button>
  <button
    class="text-purple-500 bg-transparent border border-solid border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-base px-8 py-3 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    Center
  </button>
  <button
    class="text-purple-500 bg-transparent border-t border-b border-r border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-base px-8 py-3 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    Right
  </button>
</div>

Icon group

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
      <!-- Required font awesome -->
      <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css" />

      <!-- Small -->
      <div class="flex items-center justify-center mb-4">
        <button
          class="text-purple-500 bg-transparent border-l border-t border-b border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-xs px-4 py-2 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
          type="button">
          <i class="fas fa-user"></i>
        </button>
        <button
          class="text-purple-500 bg-transparent border border-solid border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-xs px-4 py-2 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
          type="button">
          <i class="fas fa-heart"></i>
        </button>
        <button
          class="text-purple-500 bg-transparent border-t border-b border-r border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-xs px-4 py-2 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
          type="button">
          <i class="fas fa-wrench"></i>
        </button>
      </div>
      
      <!-- Medium -->
      <div class="flex items-center justify-center mb-4">
        <button
          class="text-purple-500 bg-transparent border-l border-t border-b border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-sm px-6 py-3 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
          type="button">
          <i class="fas fa-user"></i>
        </button>
        <button
          class="text-purple-500 bg-transparent border border-solid border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-sm px-6 py-3 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
          type="button">
          <i class="fas fa-heart"></i>
        </button>
        <button
          class="text-purple-500 bg-transparent border-t border-b border-r border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-sm px-6 py-3 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
          type="button">
          <i class="fas fa-wrench"></i>
        </button>
      </div>
      
      <!-- Large -->
      <div class="flex items-center justify-center mb-4">
        <button
          class="text-purple-500 bg-transparent border-l border-t border-b border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-base px-8 py-3 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
          type="button">
          <i class="fas fa-user"></i>
        </button>
        <button
          class="text-purple-500 bg-transparent border border-solid border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-base px-8 py-3 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
          type="button">
          <i class="fas fa-heart"></i>
        </button>
        <button
          class="text-purple-500 bg-transparent border-t border-b border-r border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-base px-8 py-3 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
          type="button">
          <i class="fas fa-wrench"></i>
        </button>
      </div>

Only numbers

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!-- Small -->
<div class="flex items-center justify-center mb-4">
  <button
    class="text-purple-500 bg-transparent border-l border-t border-b border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-xs px-4 py-2 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    1
  </button>
  <button
    class="text-purple-500 bg-transparent border border-solid border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-xs px-4 py-2 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    2
  </button>
  <button
    class="text-purple-500 bg-transparent border-t border-b border-r border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-xs px-4 py-2 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    3
  </button>
</div>

<!-- Medium -->
<div class="flex items-center justify-center mb-4">
  <button
    class="text-purple-500 bg-transparent border-l border-t border-b border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-sm px-6 py-3 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    1
  </button>
  <button
    class="text-purple-500 bg-transparent border border-solid border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-sm px-6 py-3 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    2
  </button>
  <button
    class="text-purple-500 bg-transparent border-t border-b border-r border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-sm px-6 py-3 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    3
  </button>
</div>

<!-- Large -->
<div class="flex items-center justify-center mb-4">
  <button
    class="text-purple-500 bg-transparent border-l border-t border-b border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-base px-8 py-3 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    1
  </button>
  <button
    class="text-purple-500 bg-transparent border border-solid border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-base px-8 py-3 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    2
  </button>
  <button
    class="text-purple-500 bg-transparent border-t border-b border-r border-purple-500 hover:bg-purple-500 hover:text-white active:bg-purple-600 font-bold uppercase text-base px-8 py-3 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
    type="button">
    3
  </button>
</div>

Filled basic

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!-- Small -->
<div class="flex items-center justify-center mb-4">
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-xs px-4 py-2 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      Left
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-xs px-4 py-2 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      Center
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-xs px-4 py-2 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      Right
  </button>
</div>

<!-- Medium -->
<div class="flex items-center justify-center mb-4">
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-sm px-6 py-3 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      Left
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-sm px-6 py-3 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      Center
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-sm px-6 py-3 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      Right
  </button>
</div>

<!-- Large -->
<div class="flex items-center justify-center mb-4">
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-base px-8 py-3 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      Left
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-base px-8 py-3 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      Center
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-base px-8 py-3 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      Right
  </button>
</div>

Filled with icons

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!-- Small -->
<div class="flex items-center justify-center mb-4">
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-xs px-4 py-2 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      <i class="fas fa-user"></i>
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-xs px-4 py-2 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      <i class="fas fa-heart"></i>
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-xs px-4 py-2 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      <i class="fas fa-wrench"></i>
  </button>
</div>

<!-- Medium -->
<div class="flex items-center justify-center mb-4">
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-sm px-6 py-3 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      <i class="fas fa-user"></i>
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-sm px-6 py-3 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      <i class="fas fa-heart"></i>
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-sm px-6 py-3 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      <i class="fas fa-wrench"></i>
  </button>
</div>

<!-- Large -->
<div class="flex items-center justify-center mb-4">
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-base px-8 py-3 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      <i class="fas fa-user"></i>
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-base px-8 py-3 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      <i class="fas fa-heart"></i>
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-base px-8 py-3 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      <i class="fas fa-wrench"></i>
  </button>
</div>

Filled only with numbers

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!-- Small -->
<div class="flex items-center justify-center mb-4">
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-xs px-4 py-2 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      1
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-xs px-4 py-2 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      2
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-xs px-4 py-2 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      3
  </button>
</div>

<!-- Medium -->
<div class="flex items-center justify-center mb-4">
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-sm px-6 py-3 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      1
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-sm px-6 py-3 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      2
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-sm px-6 py-3 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      3
  </button>
</div>

<!-- Large -->
<div class="flex items-center justify-center mb-4">
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-base px-8 py-3 rounded-l outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      1
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-base px-8 py-3 outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      2
  </button>
  <button
      class="bg-purple-500 text-white hover:bg-purple-700 hover:text-white active:bg-purple-700 font-bold uppercase text-base px-8 py-3 rounded-r outline-none focus:outline-none mb-1 ease-linear transition-all duration-150"
      type="button">
      3
  </button>
</div>