Published on

Here Are 6 Ways To Build A Google Data Studio Clone With Tailwind CSS

Tags
Google Data Studio Clone

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 Google Data Studio Clone ui component

This designed inspired from google data studio home page.

Why use Tailwind CSS to make a Google Data Studio Clone ui component?

  • It can make the building process of Google Data Studio Clone ui component faster and more easily.
  • Enables building complex responsive layouts and components freely.
  • Minimum lines of CSS code in Google Data Studio Clone component file.

The preview of Google Data Studio Clone ui component

Free download of the Google Data Studio Clone's source code

The source code of Google Data Studio Clone ui component

<header class="bg-white shadow-sm w-full fixed z-10  top-0 ">
        <div class="max-auto  px-8 py-2 bg-white">
         <div class="flex justify-between">
            <div class="logo flex items-center space-x-4 mr-10">
              <img class="h-8" src="https://www.gstatic.com/analytics-suite/header/suite/v2/ic_data_studio.svg" alt="">

                  <h1 class="text-gray-600 text-2xl">Data Studio</h1>
            </div>
            <div class="flex-1 ml-8">
               <div class="w-full inline-flex">
                <input type="text" placeholder="Search Data Studio" class="w-full rounded-md text-gray-800 bg-gray-100 focus:bg-white 
                focus:outline-none focus:shadow-lg py-3 px-10 max-w-xl text-md focus:text-gray-800" >
                <svg class="h-5  mt-4 px-4  absolute  text-gray-700" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
                  </svg>
               </div>
            </div>

            <div class=" menu flex justify-end  items-center  flex-1 space-x-4">
                <svg class="h-7   text-gray-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
                  </svg>
                  <svg  class="h-7   text-gray-800"  xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
                    <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
                  </svg>
                  <svg  class="h-7   text-gray-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z" />
                  </svg>

                  <img class="h-9 rounded-full border border-gray-100 shadow-sm" src="https://randomuser.me/api/portraits/men/11.jpg" alt="user image" />
            </div>
         </div>
        </div>
    </header>

    <div class="grid grid-cols-12 mt-20">
      <aside class="col-span-4 bg-white h-screen py-5  w-60">
        <button class="flex items-center align-middle py-2 bg-white shadow-md  rounded-3xl text-gray-800 text-sm font-semibold ml-3 border border-gray-200 hover:shadow-xl transition-all w-36  focus:outline-none">   <svg class="h-8 px-4"  viewBox="0 0 36 36"><path class="ng-tns-c17-1" d="M16 16v14h4V20z" fill="#34A853"></path><path class="ng-tns-c17-1" d="M30 16H20l-4 4h14z" fill="#4285F4"></path><path class="ng-tns-c17-1" d="M6 16v4h10l4-4z" fill="#FBBC05"></path><path class="ng-tns-c17-1" d="M20 16V6h-4v14z" fill="#EA4335"></path><path class="ng-tns-c17-1" d="M0 0h36v36H0z" fill="none"></path></svg>Create</button>


        <div class="mt-5">
          <div class="bg-blue-50 mr-50 rounded rounded-r-3xl pl-6 py-3 font-semibold">
            <button class="text-blue-500 text-sm font-semibold flex items-center  focus:outline-none">
              <svg class="h-5  px-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                <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" />
              </svg>
              Recent</button>
              
           </div>
           <div class="mt-1  mr-50 rounded rounded-r-3xl pl-6 py-3 font-semibold">
            <button class="text-gray-600  text-sm font-semibold flex items-center  focus:outline-none">
              <svg class="h-6  px-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z" />
              </svg>
              Shared with me</button>
              
           </div>

           <div class="mt-1  mr-50 rounded rounded-r-3xl pl-6 py-3 font-semibold">
            <button class="text-gray-600 text-sm font-semibold flex items-center  focus:outline-none">
              <svg class="h-6  px-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
              </svg>
              Owned by me</button>
              
           </div>

         
           <div class="mt-1  mr-50 rounded rounded-r-3xl pl-6 py-3 font-semibold">
            <button class="text-gray-600  text-sm font-semibold flex items-center focus:outline-none">
              <svg class="h-6  px-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
              </svg>
          Trash</button>
              
           </div>

  <hr class="my-2"></hr>
  <div class="mt-1  mr-50 rounded rounded-r-3xl pl-6 py-3 font-semibold">
    <button class="text-gray-600  text-sm font-semibold flex items-center focus:outline-none">
      <svg class="h-6  px-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 14v3m4-3v3m4-3v3M3 21h18M3 10h18M3 7l9-4 9 4M4 10h16v11H4V10z" />
      </svg>
  Enterprise Admin</button>


      
   </div>
        </div>
      </aside>
      <!-- Main Page -->
      <div class="col-span-4 absolute px-4  w-full pr-10">
        <div class="bg-white ml-64  mt-5">
          
          <div class="flex space-x-12">
           
              <button class="text-gray-600  text-lg font-medium flex items-center focus:outline-none">
              
         Recent</button>

  <div class="flex">
    <button class="text-blue-600 bg-blue-100  text-sm font-semibold flex items-center  focus:outline-none border border-gray-300 rounded rounded-l-md rounded-r-none px-2 py-2">
          
     Report</button>
      <button class="text-gray-600 text-sm font-semibold flex items-center  focus:outline-none border border-l-0 border-r-0  border-gray-300 px-2 py-2">
            
        Data Sources</button>
        <button class="text-gray-600 text-sm font-semibold flex items-center  focus:outline-none border border-gray-300 rounded rounded-r-md rounded-l-none px-2 py-2">
            
          Owned by me</button>
  </div>
          </div>




<hr class="my-5"></hr>


<div class="flex justify-between">
  <h3 class="font-semibold text-gray-500">Start with a Template</h3>
  <div class="flex items-center">
  <h3 class="font-semibold text-gray-500" >Template</h3>
  <svg class="h-6 text-gray-600" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l4-4 4 4m0 6l-4 4-4-4" />
  </svg>
</div>
</div>

<div class="flex mt-5">
  <div class="max-w-xs rounded overflow-hidden shadow-lg my-2py-4 border border-gray-300">
    <img class="h-28  px-8 " src="https://ssl.gstatic.com/analytics/rap/20210322_00020000/static/pngs/blank_google_add_2x.png" alt="Sunset in the mountains">
    <div class="px-2 py-2">
      <div class="font-semibold text-sm mb-2">Blank Report</div>
      <p class="font-semibold text-gray-400 text-xs">
       Data Studio
      </p>
    </div>

  </div>
</div>

          </div>
      </div>
  </div>


  <style>
    body{
      background-color:white;
    }
  </style>

How to make a Google Data Studio Clone 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 make a Google Data Studio Clone component

  • bg-white
  • w-full
  • fixed
  • z-10
  • top-0
  • max-auto
  • px-8
  • py-2
  • flex
  • mr-10
  • h-8
  • text-gray-600
  • text-2xl
  • flex-1
  • ml-8
  • inline-flex
  • text-gray-800
  • bg-gray-100
  • focus:bg-white
  • py-3
  • px-10
  • max-w-xl
  • text-md
  • focus:text-gray-800
  • h-5
  • mt-4
  • px-4
  • absolute
  • text-gray-700
  • h-7
  • text-gray-500
  • h-9
  • border-gray-100
  • grid
  • grid-cols-12
  • mt-20
  • h-screen
  • py-5
  • w-60
  • text-sm
  • ml-3
  • border-gray-200
  • w-36
  • mt-5
  • bg-blue-50
  • mr-50
  • pl-6
  • text-blue-500
  • px-3
  • mt-1
  • h-6
  • my-2
  • pr-10
  • ml-64
  • text-lg
  • text-blue-600
  • bg-blue-100
  • border-gray-300
  • px-2
  • border-l-0
  • border-r-0
  • my-5
  • max-w-xs
  • overflow-hidden
  • my-2py-4
  • h-28
  • mb-2
  • text-gray-400
  • text-xs

69 steps to make a Google Data Studio Clone component with Tailwind CSS

  1. Control the background color of an element to white using the bg-white utilities.

  2. Use w-full to set an element to a 100% based width.

  3. Use fixed to position an element relative to the browser window.

  4. 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.

  5. Use the top-0 utilities to set the top position of a positioned element to 0rem.

  6. Set the maximum width/height of an element using the max-auto utilities.

  7. Control the horizontal padding of an element to 2rem using the px-8 utilities.

  8. Control the vertical padding of an element to 0.5rem using the py-2 utilities.

  9. Use flex to create a block-level flex container.

  10. Control the margin on right side of an element to 2.5rem using the mr-10 utilities.

  11. Use h-8 to set an element to a fixed height(2rem).

  12. Control the text color of an element to gray-600 using the text-gray-600 utilities.

  13. Control the text color of an element to 2xl using the text-2xl utilities.

  14. Use flex to create a block-level flex container.

  15. Control the margin on left side of an element to 2rem using the ml-8 utilities.

  16. Use inline-flex to create an inline flex container that flows with text.

  17. Control the text color of an element to gray-800 using the text-gray-800 utilities.

  18. Control the background color of an element to gray-100 using the bg-gray-100 utilities.

  19. Control the background color of an element to white using the focus:bg-white utilities on focus.

  20. Control the vertical padding of an element to 0.75rem using the py-3 utilities.

  21. Control the horizontal padding of an element to 2.5rem using the px-10 utilities.

  22. Set the maximum width/height of an element using the max-w-xl utilities.

  23. Control the text color of an element to md using the text-md utilities.

  24. Control the text color of an element to gray-800 on focus using the focus:text-gray-800 utilities.

  25. Use h-5 to set an element to a fixed height(1.25rem).

  26. Control the margin on top side of an element to 1rem using the mt-4 utilities.

  27. Control the horizontal padding of an element to 1rem using the px-4 utilities.

  28. 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.

  29. Control the text color of an element to gray-700 using the text-gray-700 utilities.

  30. Use h-7 to set an element to a fixed height(1.75rem).

  31. Control the text color of an element to gray-500 using the text-gray-500 utilities.

  32. Use h-9 to set an element to a fixed height(2.25rem).

  33. Control the border color of an element to gray-100 using the border-gray-100 utilities.

  34. Use grid to create a grid container.

  35. Use grid to create a grid container.

  36. Control the margin on top side of an element to 5rem using the mt-20 utilities.

  37. Use h-screen to make an element span the entire height of the viewport.

  38. Control the vertical padding of an element to 1.25rem using the py-5 utilities.

  39. Use w-60 to set an element to a fixed width(15rem).

  40. Control the text color of an element to sm using the text-sm utilities.

  41. Control the margin on left side of an element to 0.75rem using the ml-3 utilities.

  42. Control the border color of an element to gray-200 using the border-gray-200 utilities.

  43. Use w-36 to set an element to a fixed width(9rem).

  44. Control the margin on top side of an element to 1.25rem using the mt-5 utilities.

  45. Control the background color of an element to blue-50 using the bg-blue-50 utilities.

  46. Control the margin on right side of an element to 12.5rem using the mr-50 utilities.

  47. Adjust the left padding of the element to 1.5rem using the pl-6 utilities class

  48. Control the text color of an element to blue-500 using the text-blue-500 utilities.

  49. Control the horizontal padding of an element to 0.75rem using the px-3 utilities.

  50. Control the margin on top side of an element to 0.25rem using the mt-1 utilities.

  51. Use h-6 to set an element to a fixed height(1.5rem).

  52. Control the vertical margin of an element to 0.5rem using the my-2 utilities.

  53. Control the padding on right side of an element to 2.5rem using the pr-10 utilities.

  54. Control the margin on left side of an element to 16rem using the ml-64 utilities.

  55. Control the text color of an element to lg using the text-lg utilities.

  56. Control the text color of an element to blue-600 using the text-blue-600 utilities.

  57. Control the background color of an element to blue-100 using the bg-blue-100 utilities.

  58. Control the border color of an element to gray-300 using the border-gray-300 utilities.

  59. Control the horizontal padding of an element to 0.5rem using the px-2 utilities.

  60. Control the border color of an element to l-0 using the border-l-0 utilities.

  61. Control the border color of an element to r-0 using the border-r-0 utilities.

  62. Control the vertical margin of an element to 1.25rem using the my-5 utilities.

  63. Set the maximum width/height of an element using the max-w-xs utilities.

  64. Use overflow-hidden to clip any content within an element that overflows the bounds of that element.

  65. Control the vertical margin of an element to 2py-4 using the my-2py-4 utilities.

  66. Use h-28 to set an element to a fixed height(7rem).

  67. Control the margin on bottom side of an element to 0.5rem using the mb-2 utilities.

  68. Control the text color of an element to gray-400 using the text-gray-400 utilities.

  69. Control the text color of an element to xs using the text-xs utilities.

Conclusion

The above is a step-by-step tutorial on how to use Tailwind CSS to make a Google Data Studio Clone components, learn and follow along to implement your own components.