- Published on
Ways To Make A Social Media Buttons With Tailwind CSS In 60 Minutes

- What is Tailwind CSS?
- The description of Social Media Buttons ui component
- Why use Tailwind CSS to build a Social Media Buttons ui component?
- The preview of Social Media Buttons ui component
- The source code of Social Media Buttons ui component
- How to build a Social Media Buttons with Tailwind CSS?
- Install tailwind css of verion 2.2.4
- All the unility class needed to build a Social Media Buttons component
- 51 steps to build a Social Media Buttons component with Tailwind CSS
- Conclusion
What is Tailwind CSS?
Tailwind CSS is a utility-first CSS framework that focuses on creating personalized user interfaces quickly. It can gives you all the building blocks you are able to create personalized designs without having to fight to override irritating opinionated styles. Also, Tailwind CSS is a highly configurable, low-level CSS framework.
The description of Social Media Buttons ui component
Made using tailwind css font awesome and tippy js
Why use Tailwind CSS to build a Social Media Buttons ui component?
- It can make the building process of Social Media Buttons ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Social Media Buttons component file.
The preview of Social Media Buttons ui component
Free download of the Social Media Buttons's source code
The source code of Social Media Buttons ui component
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://unpkg.com/@popperjs/[email protected]/dist/umd/popper.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/tippy-bundle.umd.js"></script>
<link rel="stylesheet" href="tailwind.css">
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.15.4/css/all.css"
integrity="sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm"
crossorigin="anonymous"
/>
</head>
<body>
<div class="w-screen h-screen flex items-center justify-center">
<div class="grid grid-cols-4 gap-4">
<!--Facebook Button -->
<button id="facebook" class="bg-white sticky duration-500 border-2 border-blue-600 fixed w-12 transform hover:-translate-y-3 h-12 text-2xl rounded-full hover:bg-blue-600 hover:text-white text-blue-600 ">
<i class="fab fa-facebook-f"></i>
</button>
<!--İnstagram Button -->
<button id="instagram" class=" border-2 hover:border-0 border-pink-500 bg-gradient-to-b text-2xl hover:from-indigo-600 hover:via-pink-600 hover:to-yellow-500 min-w-wull hover:text-white bg-white text-pink-600 w-12 h-12 transform hover:-translate-y-3 rounded-full duration-500 ">
<i class="fab fa-instagram"></i>
</button>
<!--Whatsapp Button -->
<button id="whatsapp" class="bg-white duration-500 w-12 h-12 border-2 rounded-full border-green-600 transform hover:-translate-y-3 text-2xl text-green-500 hover:bg-green-600 hover:text-white">
<i class="fab fa-whatsapp"></i>
</button>
<!--Twitter Button -->
<button id="twitter" class="bg-white transform hover:-translate-y-3 border-2 w-12 h-12 rounded-full duration-500 text-blue-400 border-blue-400 hover:bg-blue-400 hover:text-white text-2xl">
<i class="fab fa-twitter"></i>
</button>
<!--YouTube Button -->
<button id="youtube" class="bg-white transform hover:-translate-y-3 border-2 w-12 h-12 rounded-full duration-500 text-red-500 border-red-500 hover:bg-red-500 hover:text-white text-2xl">
<i class="fab fa-youtube"></i>
</button>
<!--Snapchat Button-->
<button id="snapchat" class="bg-white transform hover:-translate-y-3 border-2 w-12 h-12 rounded-full duration-500 text-yellow-300 border-yellow-300 hover:bg-yellow-300 hover:text-white text-2xl">
<i class="fab fa-snapchat-ghost"></i>
</button>
<!--Linkedin Button-->
<button id="linkedin" class="bg-white transform hover:-translate-y-3 border-2 w-12 h-12 rounded-full duration-500 text-blue-500 border-blue-500 hover:bg-blue-500 hover:text-white text-2xl">
<i class="fab fa-linkedin-in"></i>
</button>
<!--Tiktok Button-->
<button id="tiktok" class="bg-white transform hover:-translate-y-3 border-2 w-12 h-12 rounded-full duration-500 text-black border-black hover:bg-black hover:text-white text-2xl">
<i class="fab fa-tiktok"></i>
</button>
<!--Twitter Button -->
<button id="telegram" class="bg-white transform hover:-translate-y-3 border-2 w-12 h-12 rounded-full duration-500 text-blue-400 border-blue-400 hover:bg-blue-400 hover:text-white text-2xl">
<i class="fab fa-telegram-plane"></i>
</button>
<!--Pinterest Button -->
<button id="pinterest" class="bg-white transform hover:-translate-y-3 border-2 w-12 h-12 rounded-full duration-500 text-red-500 border-red-500 hover:bg-red-500 hover:text-white text-2xl">
<i class="fab fa-pinterest-p"></i>
</button>
<!--Spotify Button -->
<button id="spotify" class="bg-white transform hover:-translate-y-3 border-2 w-12 h-12 rounded-full duration-500 text-green-500 border-green-500 hover:bg-green-500 hover:text-white text-2xl">
<i class="fab fa-spotify"></i>
</button>
<!--Discord Button -->
<button id="discord" class="bg-white transform hover:-translate-y-3 border-2 w-12 h-12 rounded-full duration-500 text-indigo-500 border-indigo-500 hover:bg-indigo-500 hover:text-white text-2xl">
<i class="fab fa-discord"></i>
</button>
<!--Reddit Button -->
<button id="reddit" class="bg-white transform hover:-translate-y-3 border-2 w-12 h-12 rounded-full duration-500 text-yellow-600 border-yellow-600 hover:bg-yellow-600 hover:text-white text-2xl">
<i class="fab fa-reddit-alien"></i>
</button>
<!--Google Plus Button -->
<button id="googleplus" class="bg-white transform hover:-translate-y-3 border-2 w-12 h-12 rounded-full duration-500 text-red-500 border-red-500 hover:bg-red-500 hover:text-white text-2xl">
<i class="fab fa-google-plus-g"></i>
</button>
<!--Skype Button -->
<button id="skype" class="bg-white transform hover:-translate-y-3 border-2 w-12 h-12 rounded-full duration-500 text-blue-400 border-blue-400 hover:bg-blue-400 hover:text-white text-2xl">
<i class="fab fa-skype"></i>
</button>
<!--Line Button -->
<button id="line" class="bg-white transform hover:-translate-y-3 border-2 w-12 h-12 rounded-full duration-500 text-green-400 border-green-400 hover:bg-green-400 hover:text-white text-2xl">
<i class="fab fa-line"></i>
</button>
</div>
<script>
tippy('#facebook',{
content:'Facebook',
animation:'fade',
delay:[200,200]
});
tippy('#instagram',{
content:'Instagram',
animation:'fade',
delay:[200,200]
});
tippy('#whatsapp',{
content:'Whatsapp',
animation:'fade',
delay:[200,200]
});
tippy('#twitter',{
content:'Twitter',
animation:'fade',
delay:[200,200]
});
tippy('#youtube',{
content:'Youtube',
animation:'fade',
placement: 'left-start',
delay:[200,200]
});
tippy('#telegram',{
content:'Telegram',
animation:'fade',
placement: 'left-start',
delay:[200,200]
});
tippy('#reddit',{
content:'Reddit',
animation:'fade',
placement: 'bottom',
delay:[200,200]
});
tippy('#googleplus',{
content:'Google +',
animation:'fade',
placement: 'bottom',
delay:[200,200]
});
tippy('#skype',{
content:'Skype',
animation:'fade',
placement: 'bottom',
delay:[200,200]
});
tippy('#line',{
content:'Line',
animation:'fade',
placement: 'bottom',
delay:[200,200]
});
tippy('#discord',{
content:'Discord',
animation:'fade',
placement: 'right-start',
delay:[200,200]
});
tippy('#tiktok',{
content:'Tiktok',
animation:'fade',
placement: 'right-start',
delay:[200,200]
});
tippy('#linkedin',{
content:'Linkedin',
animation:'fade',
placement: 'top',
delay:[200,200]
});
tippy('#snapchat',{
content:'Snapchat',
animation:'fade',
placement: 'top',
delay:[200,200]
});
tippy('#pinterest',{
content:'Pinterest',
animation:'fade',
placement: 'bottom',
delay:[200,200],
});
tippy('#spotify',{
content:'Spotify',
animation:'fade',
placement: 'bottom',
delay:[200,200]
});
</script>
</div>
</body>
</html>
How to build a Social Media Buttons with Tailwind CSS?
Install tailwind css of verion 2.2.4
Use the script
html tag to import the script of Tailwind CSS of the version 2.2.4
<script src="https://cdn.tailwindcss.com"></script>
All the unility class needed to build a Social Media Buttons component
w-screen
h-screen
flex
grid
grid-cols-4
gap-4
bg-white
sticky
border-2
border-blue-600
fixed
w-12
h-12
text-2xl
hover:bg-blue-600
hover:text-white
text-blue-600
hover:border-0
border-pink-500
bg-gradient-to-b
min-w-wull
text-pink-600
border-green-600
text-green-500
hover:bg-green-600
text-blue-400
border-blue-400
hover:bg-blue-400
text-red-500
border-red-500
hover:bg-red-500
text-yellow-300
border-yellow-300
hover:bg-yellow-300
text-blue-500
border-blue-500
hover:bg-blue-500
text-black
border-black
hover:bg-black
border-green-500
hover:bg-green-500
text-indigo-500
border-indigo-500
hover:bg-indigo-500
text-yellow-600
border-yellow-600
hover:bg-yellow-600
text-green-400
border-green-400
hover:bg-green-400
51 steps to build a Social Media Buttons component with Tailwind CSS
Use
w-screen
to make an element span the entire width of the viewport.Use
h-screen
to make an element span the entire height of the viewport.Use
flex
to create a block-level flex container.Use
grid
to create a grid container.Use
grid
to create a grid container.To specify the width between columns, you can use the
gap-4
utilities.Control the background color of an element to white using the
bg-white
utilities.Use
sticky
to position an element asrelative
until it crosses a specified threshold, then treat it as fixed until its parent is off screen.Control the border color of an element to 0.5rem using the
border-2
utilities.Control the border color of an element to blue-600 using the
border-blue-600
utilities.Use
fixed
to position an element relative to the browser window.Use
w-12
to set an element to a fixed width(3rem).Use
h-12
to set an element to a fixed height(3rem).Control the text color of an element to 2xl using the
text-2xl
utilities.Control the background color of an element to blue-600 using the
hover:bg-blue-600
utilities on hover.Control the text color of an element to white on hover using the
hover:text-white
utilities.Control the text color of an element to blue-600 using the
text-blue-600
utilities.Control the border color of an element to 0rem using the
hover:border-0
utilities on hover.Control the border color of an element to pink-500 using the
border-pink-500
utilities.Control the background color of an element to gradient-to-b using the
bg-gradient-to-b
utilities.Set the minimum width/height of an element using the
min-w-wull
utilities.Control the text color of an element to pink-600 using the
text-pink-600
utilities.Control the border color of an element to green-600 using the
border-green-600
utilities.Control the text color of an element to green-500 using the
text-green-500
utilities.Control the background color of an element to green-600 using the
hover:bg-green-600
utilities on hover.Control the text color of an element to blue-400 using the
text-blue-400
utilities.Control the border color of an element to blue-400 using the
border-blue-400
utilities.Control the background color of an element to blue-400 using the
hover:bg-blue-400
utilities on hover.Control the text color of an element to red-500 using the
text-red-500
utilities.Control the border color of an element to red-500 using the
border-red-500
utilities.Control the background color of an element to red-500 using the
hover:bg-red-500
utilities on hover.Control the text color of an element to yellow-300 using the
text-yellow-300
utilities.Control the border color of an element to yellow-300 using the
border-yellow-300
utilities.Control the background color of an element to yellow-300 using the
hover:bg-yellow-300
utilities on hover.Control the text color of an element to blue-500 using the
text-blue-500
utilities.Control the border color of an element to blue-500 using the
border-blue-500
utilities.Control the background color of an element to blue-500 using the
hover:bg-blue-500
utilities on hover.Control the text color of an element to black using the
text-black
utilities.Control the border color of an element to black using the
border-black
utilities.Control the background color of an element to black using the
hover:bg-black
utilities on hover.Control the border color of an element to green-500 using the
border-green-500
utilities.Control the background color of an element to green-500 using the
hover:bg-green-500
utilities on hover.Control the text color of an element to indigo-500 using the
text-indigo-500
utilities.Control the border color of an element to indigo-500 using the
border-indigo-500
utilities.Control the background color of an element to indigo-500 using the
hover:bg-indigo-500
utilities on hover.Control the text color of an element to yellow-600 using the
text-yellow-600
utilities.Control the border color of an element to yellow-600 using the
border-yellow-600
utilities.Control the background color of an element to yellow-600 using the
hover:bg-yellow-600
utilities on hover.Control the text color of an element to green-400 using the
text-green-400
utilities.Control the border color of an element to green-400 using the
border-green-400
utilities.Control the background color of an element to green-400 using the
hover:bg-green-400
utilities on hover.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to build a Social Media Buttons components, learn and follow along to implement your own components.