- Published on
The Ninja Guide To How To Build A Intercom Chat UI With Tailwind CSS Better

- What is Tailwind CSS?
- The description of Intercom Chat UI ui component
- Why use Tailwind CSS to create a Intercom Chat UI ui component?
- The preview of Intercom Chat UI ui component
- The source code of Intercom Chat UI ui component
- How to create a Intercom Chat UI with Tailwind CSS?
- Install tailwind css of verion 2.0.3
- All the unility class needed to create a Intercom Chat UI component
- 65 steps to create a Intercom Chat UI 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 Intercom Chat UI ui component
Intercom chat ui
Why use Tailwind CSS to create a Intercom Chat UI ui component?
- It can make the building process of Intercom Chat UI ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Intercom Chat UI component file.
The preview of Intercom Chat UI ui component
Free download of the Intercom Chat UI's source code
The source code of Intercom Chat UI ui component
<div class="bg-white h-screen flex flex-col items-end">
<div class="flex-1 mt-16 mr-4 w-96 bg-white shadow-xl rounded-lg relative overflow-hidden">
<div class="bg-blue-700 h-64 rounded-t-lg absolute w-full z-0"></div>
<div class="flex flex-col overflow-y-auto h-full p-4 space-y-4">
<div class="flex flex-col z-10 ml-4 text-white">
<svg class="w-10 h-10 mb-3 -ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"></path></svg>
<div class="text-3xl mb-2">Hi Sophie 👋</div>
<div class="w-60 text-gray-200 text-sm mb-1">We help your business grow by connecting you to your customers.</div>
</div>
<div class="border-0 border-t-4 border-blue-500 rounded z-10 shadow-md text-sm">
<div class="bg-white border border-t-0 rounded-t-none rounded-b flex flex-col space-y-2">
<div class="px-6 py-4 flex flex-col items-start gap-3">
<div class="font-semibold ">Start a conversation</div>
<div class="flex flex-row gap-3">
<div class="flex flex-row -space-x-10">
<img class="w-16 h-16 rounded-full border-2 border-white" src="https://images.unsplash.com/photo-1544725176-7c40e5a71c5e?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=facearea&w=256&h=256&facepad=2" />
<img class="w-16 h-16 rounded-full border-2 border-white" src="https://images.unsplash.com/flagged/photo-1570612861542-284f4c12e75f?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=facearea&w=256&h=256&facepad=2" />
<img class="w-16 h-16 rounded-full border-2 border-white" src="https://images.unsplash.com/photo-1499952127939-9bbf5af6c51c?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=facearea&w=256&h=256&facepad=2" />
</div>
<div class="flex flex-col justify-center">
<div class="text-gray-400">Our usual reply time</div>
<div class="flex flex-row items-center gap-1 font-semibold">
<svg class="w-4 h-4 text-blue-700" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
A few minutes
</div>
</div>
</div>
<button type="button" class="bg-blue-700 rounded-full text-white flex flex-row gap-2 py-3 px-5">
<svg class="w-5 h-5 transform rotate-90" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"></path></svg>
Send us a message
</button>
</div>
<div class="border-t px-6 py-4">
<a href="#" class="text-sm text-blue-500 hover:text-blue-300">See all your conversations</a>
</div>
</div>
</div>
<div class="border-0 border-t-4 border-blue-500 rounded z-10 shadow-md">
<div class="bg-white border border-t-0 rounded-t-none rounded-b p-6 flex flex-col space-y-2">
<div class="font-semibold text-sm">Find your answer now</div>
<div class="flex flex-row">
<input type="text" placeholder="Search our articles" class="border flex-1 rounded-l p-2 text-sm shadow-inner outline-none bg-gray-50 focus:bg-white">
<button type="button" class="bg-blue-700 p-2 rounded-r">
<svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg>
</button>
</div>
</div>
</div>
<div class="bg-white border rounded flex items-center justify-center p-8 z-10">
this is a card
</div>
<div class="bg-white border rounded flex items-center justify-center p-8 z-10">
this is a card
</div>
</div>
</div>
<div class="bg-blue-600 rounded-full w-16 h-16 m-4 flex items-center justify-center cursor-pointer shadow-xl">
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg>
</div>
</div>
How to create a Intercom Chat UI with Tailwind CSS?
Install tailwind css of verion 2.0.3
Use the script
html tag to import the script of Tailwind CSS of the version 2.0.3
<script src="https://cdn.tailwindcss.com"></script>
All the unility class needed to create a Intercom Chat UI component
bg-white
h-screen
flex
flex-col
flex-1
mt-16
mr-4
w-96
relative
overflow-hidden
bg-blue-700
h-64
absolute
w-full
z-0
overflow-y-auto
h-full
p-4
z-10
ml-4
text-white
w-10
h-10
mb-3
-ml-1
text-3xl
mb-2
w-60
text-gray-200
text-sm
mb-1
border-0
border-t-4
border-blue-500
border-t-0
px-6
py-4
gap-3
flex-row
w-16
h-16
border-2
border-white
text-gray-400
gap-1
w-4
h-4
text-blue-700
gap-2
py-3
px-5
w-5
h-5
border-t
text-blue-500
hover:text-blue-300
p-6
p-2
bg-gray-50
focus:bg-white
p-8
bg-blue-600
m-4
w-6
h-6
65 steps to create a Intercom Chat UI component with Tailwind CSS
Control the background color of an element to white using the
bg-white
utilities.Use
h-screen
to make an element span the entire height of the viewport.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Control the margin on top side of an element to 4rem using the
mt-16
utilities.Control the margin on right side of an element to 1rem using the
mr-4
utilities.Use
w-96
to set an element to a fixed width(24rem).Use
relative
to position an element according to the normal flow of the document.Use
overflow-hidden
to clip any content within an element that overflows the bounds of that element.Control the background color of an element to blue-700 using the
bg-blue-700
utilities.Use
h-64
to set an element to a fixed height(16rem).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.Use
w-full
to set an element to a 100% based width.Control the stack order (or three-dimensional positioning) of an element to 0 in Tailwind, regardless of order it has been displayed, using the
z-0
utilities.Use
overflow-y-auto
to allow vertical scrolling if needed.Use
h-full
to set an element’s height to 100% of its parent, as long as the parent has a defined height.Control the padding on all sides of an element to 1rem using the
p-4
utilities.Control the stack order (or three-dimensional positioning) of an element to 10 in Tailwind, regardless of order it has been displayed, using the
z-10
utilities.Control the margin on left side of an element to 1rem using the
ml-4
utilities.Control the text color of an element to white using the
text-white
utilities.Use
w-10
to set an element to a fixed width(2.5rem).Use
h-10
to set an element to a fixed height(2.5rem).Control the margin on bottom side of an element to 0.75rem using the
mb-3
utilities.Control the margin on left side of an element to -0.25rem using the
-ml-1
utilities.Control the text color of an element to 3xl using the
text-3xl
utilities.Control the margin on bottom side of an element to 0.5rem using the
mb-2
utilities.Use
w-60
to set an element to a fixed width(15rem).Control the text color of an element to gray-200 using the
text-gray-200
utilities.Control the text color of an element to sm using the
text-sm
utilities.Control the margin on bottom side of an element to 0.25rem using the
mb-1
utilities.Control the border color of an element to 0rem using the
border-0
utilities.Control the border color of an element to t-4 using the
border-t-4
utilities.Control the border color of an element to blue-500 using the
border-blue-500
utilities.Control the border color of an element to t-0 using the
border-t-0
utilities.Control the horizontal padding of an element to 1.5rem using the
px-6
utilities.Control the vertical padding of an element to 1rem using the
py-4
utilities.To specify the width between columns, you can use the
gap-3
utilities.Use
flex
to create a block-level flex container.Use
w-16
to set an element to a fixed width(4rem).Use
h-16
to set an element to a fixed height(4rem).Control the border color of an element to 0.5rem using the
border-2
utilities.Control the border color of an element to white using the
border-white
utilities.Control the text color of an element to gray-400 using the
text-gray-400
utilities.To specify the width between columns, you can use the
gap-1
utilities.Use
w-4
to set an element to a fixed width(1rem).Use
h-4
to set an element to a fixed height(1rem).Control the text color of an element to blue-700 using the
text-blue-700
utilities.To specify the width between columns, you can use the
gap-2
utilities.Control the vertical padding of an element to 0.75rem using the
py-3
utilities.Control the horizontal padding of an element to 1.25rem using the
px-5
utilities.Use
w-5
to set an element to a fixed width(1.25rem).Use
h-5
to set an element to a fixed height(1.25rem).Control the border color of an element to t using the
border-t
utilities.Control the text color of an element to blue-500 using the
text-blue-500
utilities.Control the text color of an element to blue-300 on hover using the
hover:text-blue-300
utilities.Control the padding on all sides of an element to 1.5rem using the
p-6
utilities.Control the padding on all sides of an element to 0.5rem using the
p-2
utilities.Control the background color of an element to gray-50 using the
bg-gray-50
utilities.Control the background color of an element to white using the
focus:bg-white
utilities on focus.Control the padding on all sides of an element to 2rem using the
p-8
utilities.Control the background color of an element to blue-600 using the
bg-blue-600
utilities.Control the margin on all sides of an element to 1rem using the
m-4
utilities.Use
w-6
to set an element to a fixed width(1.5rem).Use
h-6
to set an element to a fixed height(1.5rem).
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to create a Intercom Chat UI components, learn and follow along to implement your own components.