- Published on
A Complete Guide To Make A Slack Clone With Tailwind CSS

- What is Tailwind CSS?
- The description of Slack Clone ui component
- Why use Tailwind CSS to create a Slack Clone ui component?
- The preview of Slack Clone ui component
- The source code of Slack Clone ui component
- How to create a Slack Clone with Tailwind CSS?
- Install tailwind css of verion 0.3.0
- All the unility class needed to create a Slack Clone component
- 78 steps to create a Slack Clone 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 Slack Clone ui component
A more polished slack clone
Why use Tailwind CSS to create a Slack Clone ui component?
- It can make the building process of Slack Clone ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Slack Clone component file.
The preview of Slack Clone ui component
Free download of the Slack Clone's source code
The source code of Slack Clone ui component
<div class="font-sans antialiased h-screen flex">
<!-- Sidebar / channel list -->
<div class="bg-indigo-darkest text-purple-lighter flex-none w-24 p-6 hidden md:block">
<div class="cursor-pointer mb-4">
<div class="bg-white h-12 w-12 flex items-center justify-center text-black text-2xl font-semibold rounded-lg mb-1 overflow-hidden">
<img src="https://pbs.twimg.com/profile_images/895274026783866881/E1G1nNb0_400x400.jpg" alt="">
</div>
<div class="text-center text-white opacity-50 text-sm">⌘1</div>
</div>
<div class="cursor-pointer mb-4">
<div class="bg-indigo-lighter opacity-25 h-12 w-12 flex items-center justify-center text-black text-2xl font-semibold rounded-lg mb-1 overflow-hidden">
L
</div>
<div class="text-center text-white opacity-50 text-sm">⌘2</div>
</div>
<div class="cursor-pointer">
<div class="bg-white opacity-25 h-12 w-12 flex items-center justify-center text-black text-2xl font-semibold rounded-lg mb-1 overflow-hidden">
<svg class="fill-current h-10 w-10 block" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M16 10c0 .553-.048 1-.601 1H11v4.399c0 .552-.447.601-1 .601-.553 0-1-.049-1-.601V11H4.601C4.049 11 4 10.553 4 10c0-.553.049-1 .601-1H9V4.601C9 4.048 9.447 4 10 4c.553 0 1 .048 1 .601V9h4.399c.553 0 .601.447.601 1z"/></svg>
</div>
</div>
</div>
<div class="bg-indigo-darker text-purple-lighter flex-none w-64 pb-6 hidden md:block">
<div class="text-white mb-2 mt-3 px-4 flex justify-between">
<div class="flex-auto">
<h1 class="font-semibold text-xl leading-tight mb-1 truncate">Tailwind CSS</h1>
<div class="flex items-center mb-6">
<span class="bg-green rounded-full block w-2 h-2 mr-2"></span>
<span class="text-white opacity-50 text-sm">Adam Wathan</span>
</div>
</div>
<div>
<svg class="h-6 w-6 fill-current text-white opacity-25" viewBox="0 0 20 20">
<path d="M14 8a4 4 0 1 0-8 0v7h8V8zM8.027 2.332A6.003 6.003 0 0 0 4 8v6l-3 2v1h18v-1l-3-2V8a6.003 6.003 0 0 0-4.027-5.668 2 2 0 1 0-3.945 0zM12 18a2 2 0 1 1-4 0h4z" fill-rule="evenodd" />
</svg>
</div>
</div>
<div class="mb-8">
<div class="px-4 mb-2 text-white flex justify-between items-center">
<div class="opacity-75">Channels</div>
<div>
<svg class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path d="M11 9h4v2h-4v4H9v-4H5V9h4V5h2v4zm-1 11a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" />
</svg>
</div>
</div>
<div class="bg-teal-dark py-1 px-4 text-white"># general</div>
</div>
<div class="mb-8">
<div class="px-4 mb-2 text-white flex justify-between items-center">
<div class="opacity-75">Direct Messages</div>
<div>
<svg class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path d="M11 9h4v2h-4v4H9v-4H5V9h4V5h2v4zm-1 11a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" />
</svg>
</div>
</div>
<div class="flex items-center mb-3 px-4">
<span class="bg-green rounded-full block w-2 h-2 mr-2"></span>
<span class="text-white opacity-75">Adam Wathan <span class="text-grey text-sm">(you)</span></span>
</div>
<div class="flex items-center mb-3 px-4">
<span class="bg-green rounded-full block w-2 h-2 mr-2"></span>
<span class="text-white opacity-75">David Hemphill</span>
</div>
<div class="flex items-center px-4 mb-6 opacity-50">
<span class="border border-white rounded-full w-2 h-2 mr-2"></span>
<span class="text-white">Steve Schoger</span>
</div>
</div>
<div>
<div class="px-4 mb-2 text-white flex justify-between items-center">
<div class="opacity-75">Apps</div>
<div>
<svg class="fill-current h-4 w-4 opacity-50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path d="M11 9h4v2h-4v4H9v-4H5V9h4V5h2v4zm-1 11a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" />
</svg>
</div>
</div>
</div>
</div>
<!-- Chat content -->
<div class="flex-1 flex flex-col bg-white overflow-hidden">
<!-- Top bar -->
<div class="border-b flex px-6 py-2 items-center flex-none">
<div class="flex flex-col">
<h3 class="text-grey-darkest mb-1 font-extrabold">#general</h3>
<div class="text-grey-dark text-sm truncate">
Chit-chattin' about ugly HTML and mixing of concerns.
</div>
</div>
<div class="ml-auto hidden md:block">
<div class="relative">
<input type="search" placeholder="Search" class="appearance-none border border-grey rounded-lg pl-8 pr-4 py-2">
<div class="absolute pin-y pin-l pl-3 flex items-center justify-center">
<svg class="fill-current text-grey h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<path d="M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z" />
</svg>
</div>
</div>
</div>
</div>
<!-- Chat messages -->
<div class="px-6 py-4 flex-1 overflow-y-scroll">
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/875010472105222144/Pkt9zqPY_400x400.jpg" class="w-10 h-10 rounded mr-3">
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">Steve Schoger</span>
<span class="text-grey text-xs">11:46</span>
</div>
<p class="text-black leading-normal">The slack from the other side.</p>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/887661330832003072/Zp6rA_e2_400x400.jpg" class="w-10 h-10 rounded mr-3" />
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">Adam Wathan</span>
<span class="text-grey text-xs">12:45</span>
</div>
<p class="text-black leading-normal">How are we supposed to control the marquee space without an utility for it? I propose this:</p>
<div class="bg-grey-lighter border border-grey-light text-grey-darkest text-sm font-mono rounded p-3 mt-2 whitespace-pre overflow-scroll">.marquee-lightspeed { -webkit-marquee-speed: fast; }
.marquee-lightspeeder { -webkit-marquee-speed: faster; }</div>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/929910740156215296/yDEC9GW9_400x400.jpg" class="w-10 h-10 rounded mr-3" />
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">David Hemphill</span>
<span class="text-grey text-xs">12:46</span>
</div>
<p class="text-black leading-normal"><a href="#" class="inline-block bg-blue-lightest text-blue no-underline">@Adam Wathan</a> the size of the generated CSS is creating a singularity in space/time, we must stop adding more utilities before it's too late!</p>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/875010472105222144/Pkt9zqPY_400x400.jpg" class="w-10 h-10 rounded mr-3">
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">Steve Schoger</span>
<span class="text-grey text-xs">11:46</span>
</div>
<p class="text-black leading-normal">The slack from the other side.</p>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/887661330832003072/Zp6rA_e2_400x400.jpg" class="w-10 h-10 rounded mr-3" />
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">Adam Wathan</span>
<span class="text-grey text-xs">12:45</span>
</div>
<p class="text-black leading-normal">How are we supposed to control the marquee space without an utility for it? I propose this:</p>
<div class="bg-grey-lighter border border-grey-light text-grey-darkest text-sm font-mono rounded p-3 mt-2 whitespace-pre overflow-scroll">.marquee-lightspeed { -webkit-marquee-speed: fast; }
.marquee-lightspeeder { -webkit-marquee-speed: faster; }</div>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/929910740156215296/yDEC9GW9_400x400.jpg" class="w-10 h-10 rounded mr-3" />
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">David Hemphill</span>
<span class="text-grey text-xs">12:46</span>
</div>
<p class="text-black leading-normal"><a href="#" class="inline-block bg-blue-lightest text-blue no-underline">@Adam Wathan</a> the size of the generated CSS is creating a singularity in space/time, we must stop adding more utilities before it's too late!</p>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/875010472105222144/Pkt9zqPY_400x400.jpg" class="w-10 h-10 rounded mr-3">
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">Steve Schoger</span>
<span class="text-grey text-xs">11:46</span>
</div>
<p class="text-black leading-normal">The slack from the other side.</p>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/887661330832003072/Zp6rA_e2_400x400.jpg" class="w-10 h-10 rounded mr-3" />
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">Adam Wathan</span>
<span class="text-grey text-xs">12:45</span>
</div>
<p class="text-black leading-normal">How are we supposed to control the marquee space without an utility for it? I propose this:</p>
<div class="bg-grey-lighter border border-grey-light text-grey-darkest text-sm font-mono rounded p-3 mt-2 whitespace-pre overflow-scroll">.marquee-lightspeed { -webkit-marquee-speed: fast; }
.marquee-lightspeeder { -webkit-marquee-speed: faster; }</div>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/929910740156215296/yDEC9GW9_400x400.jpg" class="w-10 h-10 rounded mr-3" />
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">David Hemphill</span>
<span class="text-grey text-xs">12:46</span>
</div>
<p class="text-black leading-normal"><a href="#" class="inline-block bg-blue-lightest text-blue no-underline">@Adam Wathan</a> the size of the generated CSS is creating a singularity in space/time, we must stop adding more utilities before it's too late!</p>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/875010472105222144/Pkt9zqPY_400x400.jpg" class="w-10 h-10 rounded mr-3">
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">Steve Schoger</span>
<span class="text-grey text-xs">11:46</span>
</div>
<p class="text-black leading-normal">The slack from the other side.</p>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/887661330832003072/Zp6rA_e2_400x400.jpg" class="w-10 h-10 rounded mr-3" />
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">Adam Wathan</span>
<span class="text-grey text-xs">12:45</span>
</div>
<p class="text-black leading-normal">How are we supposed to control the marquee space without an utility for it? I propose this:</p>
<div class="bg-grey-lighter border border-grey-light text-grey-darkest text-sm font-mono rounded p-3 mt-2 whitespace-pre overflow-scroll">.marquee-lightspeed { -webkit-marquee-speed: fast; }
.marquee-lightspeeder { -webkit-marquee-speed: faster; }</div>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/929910740156215296/yDEC9GW9_400x400.jpg" class="w-10 h-10 rounded mr-3" />
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">David Hemphill</span>
<span class="text-grey text-xs">12:46</span>
</div>
<p class="text-black leading-normal"><a href="#" class="inline-block bg-blue-lightest text-blue no-underline">@Adam Wathan</a> the size of the generated CSS is creating a singularity in space/time, we must stop adding more utilities before it's too late!</p>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/875010472105222144/Pkt9zqPY_400x400.jpg" class="w-10 h-10 rounded mr-3">
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">Steve Schoger</span>
<span class="text-grey text-xs">11:46</span>
</div>
<p class="text-black leading-normal">The slack from the other side.</p>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/887661330832003072/Zp6rA_e2_400x400.jpg" class="w-10 h-10 rounded mr-3" />
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">Adam Wathan</span>
<span class="text-grey text-xs">12:45</span>
</div>
<p class="text-black leading-normal">How are we supposed to control the marquee space without an utility for it? I propose this:</p>
<div class="bg-grey-lighter border border-grey-light text-grey-darkest text-sm font-mono rounded p-3 mt-2 whitespace-pre overflow-scroll">.marquee-lightspeed { -webkit-marquee-speed: fast; }
.marquee-lightspeeder { -webkit-marquee-speed: faster; }</div>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/929910740156215296/yDEC9GW9_400x400.jpg" class="w-10 h-10 rounded mr-3" />
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">David Hemphill</span>
<span class="text-grey text-xs">12:46</span>
</div>
<p class="text-black leading-normal"><a href="#" class="inline-block bg-blue-lightest text-blue no-underline">@Adam Wathan</a> the size of the generated CSS is creating a singularity in space/time, we must stop adding more utilities before it's too late!</p>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/875010472105222144/Pkt9zqPY_400x400.jpg" class="w-10 h-10 rounded mr-3">
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">Steve Schoger</span>
<span class="text-grey text-xs">11:46</span>
</div>
<p class="text-black leading-normal">The slack from the other side.</p>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/887661330832003072/Zp6rA_e2_400x400.jpg" class="w-10 h-10 rounded mr-3" />
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">Adam Wathan</span>
<span class="text-grey text-xs">12:45</span>
</div>
<p class="text-black leading-normal">How are we supposed to control the marquee space without an utility for it? I propose this:</p>
<div class="bg-grey-lighter border border-grey-light text-grey-darkest text-sm font-mono rounded p-3 mt-2 whitespace-pre overflow-scroll">.marquee-lightspeed { -webkit-marquee-speed: fast; }
.marquee-lightspeeder { -webkit-marquee-speed: faster; }</div>
</div>
</div>
<!-- A message -->
<div class="flex items-start mb-4 text-sm">
<img src="https://pbs.twimg.com/profile_images/929910740156215296/yDEC9GW9_400x400.jpg" class="w-10 h-10 rounded mr-3" />
<div class="flex-1 overflow-hidden">
<div>
<span class="font-bold">David Hemphill</span>
<span class="text-grey text-xs">12:46</span>
</div>
<p class="text-black leading-normal"><a href="#" class="inline-block bg-blue-lightest text-blue no-underline">@Adam Wathan</a> the size of the generated CSS is creating a singularity in space/time, we must stop adding more utilities before it's too late!</p>
</div>
</div>
</div>
<div class="pb-6 px-4 flex-none">
<div class="flex rounded-lg border-2 border-grey overflow-hidden">
<span class="text-3xl text-grey border-r-2 border-grey p-2">
<svg class="fill-current h-6 w-6 block" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M16 10c0 .553-.048 1-.601 1H11v4.399c0 .552-.447.601-1 .601-.553 0-1-.049-1-.601V11H4.601C4.049 11 4 10.553 4 10c0-.553.049-1 .601-1H9V4.601C9 4.048 9.447 4 10 4c.553 0 1 .048 1 .601V9h4.399c.553 0 .601.447.601 1z"/></svg>
</span>
<input type="text" class="w-full px-4" placeholder="Message #general" />
</div>
</div>
</div>
</div>
How to create a Slack Clone with Tailwind CSS?
Install tailwind css of verion 0.3.0
Use the link
html tag to import the stylesheet of Tailwind CSS of the version 0.3.0
<link href=https://unpkg.com/[email protected]/dist/tailwind.min.css rel="stylesheet">
All the unility class needed to create a Slack Clone component
h-screen
flex
bg-indigo-darkest
text-purple-lighter
flex-none
w-24
p-6
hidden
md:block
mb-4
bg-white
h-12
w-12
text-black
text-2xl
mb-1
overflow-hidden
text-center
text-white
text-sm
bg-indigo-lighter
h-10
w-10
block
bg-indigo-darker
w-64
pb-6
mb-2
mt-3
px-4
flex-auto
text-xl
mb-6
bg-green
w-2
h-2
mr-2
h-6
w-6
mb-8
h-4
w-4
bg-teal-dark
py-1
mb-3
text-grey
border-white
flex-1
flex-col
border-b
px-6
py-2
text-grey-darkest
text-grey-dark
ml-auto
relative
border-grey
pl-8
pr-4
absolute
pl-3
py-4
overflow-y-scroll
mr-3
text-xs
bg-grey-lighter
border-grey-light
p-3
mt-2
overflow-scroll
inline-block
bg-blue-lightest
text-blue
border-2
text-3xl
border-r-2
p-2
w-full
78 steps to create a Slack Clone component with Tailwind CSS
Use
h-screen
to make an element span the entire height of the viewport.Use
flex
to create a block-level flex container.Control the background color of an element to indigo-darkest using the
bg-indigo-darkest
utilities.Control the text color of an element to purple-lighter using the
text-purple-lighter
utilities.Use
flex
to create a block-level flex container.Use
w-24
to set an element to a fixed width(6rem).Control the padding on all sides of an element to 1.5rem using the
p-6
utilities.Use
hidden
to set an element to display: none and remove it from the page layout.Use
inline
utilities to put the element on its own line and fill its parent at only medium screen sizes.Control the margin on bottom side of an element to 1rem using the
mb-4
utilities.Control the background color of an element to white using the
bg-white
utilities.Use
h-12
to set an element to a fixed height(3rem).Use
w-12
to set an element to a fixed width(3rem).Control the text color of an element to black using the
text-black
utilities.Control the text color of an element to 2xl using the
text-2xl
utilities.Control the margin on bottom side of an element to 0.25rem using the
mb-1
utilities.Use
overflow-hidden
to clip any content within an element that overflows the bounds of that element.Control the text color of an element to center using the
text-center
utilities.Control the text color of an element to white using the
text-white
utilities.Control the text color of an element to sm using the
text-sm
utilities.Control the background color of an element to indigo-lighter using the
bg-indigo-lighter
utilities.Use
h-10
to set an element to a fixed height(2.5rem).Use
w-10
to set an element to a fixed width(2.5rem).Use
inline
utilities to put the element on its own line and fill its parent.Control the background color of an element to indigo-darker using the
bg-indigo-darker
utilities.Use
w-64
to set an element to a fixed width(16rem).Control the padding on bottom side of an element to 1.5rem using the
pb-6
utilities.Control the margin on bottom side of an element to 0.5rem using the
mb-2
utilities.Control the margin on top side of an element to 0.75rem using the
mt-3
utilities.Control the horizontal padding of an element to 1rem using the
px-4
utilities.Use
flex
to create a block-level flex container.Control the text color of an element to xl using the
text-xl
utilities.Control the margin on bottom side of an element to 1.5rem using the
mb-6
utilities.Control the background color of an element to green using the
bg-green
utilities.Use
w-2
to set an element to a fixed width(0.5rem).Use
h-2
to set an element to a fixed height(0.5rem).Control the margin on right side of an element to 0.5rem using the
mr-2
utilities.Use
h-6
to set an element to a fixed height(1.5rem).Use
w-6
to set an element to a fixed width(1.5rem).Control the margin on bottom side of an element to 2rem using the
mb-8
utilities.Use
h-4
to set an element to a fixed height(1rem).Use
w-4
to set an element to a fixed width(1rem).Control the background color of an element to teal-dark using the
bg-teal-dark
utilities.Control the vertical padding of an element to 0.25rem using the
py-1
utilities.Control the margin on bottom side of an element to 0.75rem using the
mb-3
utilities.Control the text color of an element to grey using the
text-grey
utilities.Control the border color of an element to white using the
border-white
utilities.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Control the border color of an element to b using the
border-b
utilities.Control the horizontal padding of an element to 1.5rem using the
px-6
utilities.Control the vertical padding of an element to 0.5rem using the
py-2
utilities.Control the text color of an element to grey-darkest using the
text-grey-darkest
utilities.Control the text color of an element to grey-dark using the
text-grey-dark
utilities.Control the margin on left side of an element to auto using the
ml-auto
utilities.Use
relative
to position an element according to the normal flow of the document.Control the border color of an element to grey using the
border-grey
utilities.Adjust the left padding of an element to 2rem using the
pl-8
utilities classControl the padding on right side of an element to 1rem using the
pr-4
utilities.Use
absolute
to position an element outside of the normal flow of the document, causing neighboring elements to act as if the element doesn’t exist.Adjust the left padding of an element to 0.75rem using the
pl-3
utilities classControl the vertical padding of an element to 1rem using the
py-4
utilities.Use
overflow-y-scroll
to allow vertical scrolling and always show scrollbars unless always-visible scrollbars are disabled by the operating system.Control the margin on right side of an element to 0.75rem using the
mr-3
utilities.Control the text color of an element to xs using the
text-xs
utilities.Control the background color of an element to grey-lighter using the
bg-grey-lighter
utilities.Control the border color of an element to grey-light using the
border-grey-light
utilities.Control the padding on all sides of an element to 0.75rem using the
p-3
utilities.Control the margin on top side of an element to 0.5rem using the
mt-2
utilities.Use
overflow-scroll
to add scrollbars to an element. Unlike.overflow-auto
, which only shows scrollbars if they are necessary, this utility always shows them. Note that some operating systems (like macOS) hide unnecessary scrollbars regardless of this setting.Use
inline-block
utilities to wrap the element to prevent the text inside from extending beyond its parent.Control the background color of an element to blue-lightest using the
bg-blue-lightest
utilities.Control the text color of an element to blue using the
text-blue
utilities.Control the border color of an element to 0.5rem using the
border-2
utilities.Control the text color of an element to 3xl using the
text-3xl
utilities.Control the border color of an element to r-2 using the
border-r-2
utilities.Control the padding on all sides of an element to 0.5rem using the
p-2
utilities.Use
w-full
to set an element to a 100% based width.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to create a Slack Clone components, learn and follow along to implement your own components.