Published on

Best Ways To Make A Sam Rabili With Tailwind CSS

Tags
Sam Rabili

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 Sam Rabili ui component

Buttons with icons

Why use Tailwind CSS to make a Sam Rabili ui component?

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

The preview of Sam Rabili ui component

Free download of the Sam Rabili's source code

The source code of Sam Rabili ui component

<div class="flex justify-center items-center space-x-4 h-screen">
  <div class="flex text-green-500 border border-green-500 rounded shadow-lg rin">
    <p class="text-xs px-2 inline-flex items-center"><span class=""><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
  <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
</svg></span>Active</p>
  </div>
    <div class="flex text-blue-500 border border-blue-500 rounded shadow-lg rin">
    <p class="text-xs px-2 inline-flex items-center"><span class=""><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
  <path fill-rule="evenodd" d="M6 2a2 2 0 00-2 2v12a2 2 0 002 2h8a2 2 0 002-2V7.414A2 2 0 0015.414 6L12 2.586A2 2 0 0010.586 2H6zm2 10a1 1 0 10-2 0v3a1 1 0 102 0v-3zm2-3a1 1 0 011 1v5a1 1 0 11-2 0v-5a1 1 0 011-1zm4-1a1 1 0 10-2 0v7a1 1 0 102 0V8z" clip-rule="evenodd" />
</svg></span>Stats</p>
  </div>
      <div class="flex text-red-500 border border-red-500 rounded shadow-lg rin">
    <p class="text-xs px-2 inline-flex items-center"><span class=""><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
  <path fill-rule="evenodd" d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z" clip-rule="evenodd" />
</svg></span>Favorite</p>
  </div>
        <div class="flex text-yellow-500 border border-yellow-500 rounded shadow-lg rin">
    <p class="text-xs px-2 inline-flex items-center"><span class=""><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
  <path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
</svg></span>Bookmark</p>
  </div>
</div>

How to make a Sam Rabili 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 make a Sam Rabili component

  • flex
  • h-screen
  • text-green-500
  • border-green-500
  • text-xs
  • px-2
  • inline-flex
  • h-5
  • w-5
  • text-blue-500
  • border-blue-500
  • text-red-500
  • border-red-500
  • text-yellow-500
  • border-yellow-500

15 steps to make a Sam Rabili component with Tailwind CSS

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

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

  3. Control the text color of an element to green-500 using the text-green-500 utilities.

  4. Control the border color of an element to green-500 using the border-green-500 utilities.

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

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

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

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

  9. Use w-5 to set an element to a fixed width(1.25rem).

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

  11. Control the border color of an element to blue-500 using the border-blue-500 utilities.

  12. Control the text color of an element to red-500 using the text-red-500 utilities.

  13. Control the border color of an element to red-500 using the border-red-500 utilities.

  14. Control the text color of an element to yellow-500 using the text-yellow-500 utilities.

  15. Control the border color of an element to yellow-500 using the border-yellow-500 utilities.

Conclusion

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