DEV Community

Cover image for Tailwind Chips
Keep Coding
Keep Coding

Posted on

Tailwind Chips

Responsive chips built with the latest Tailwind. Chips (aka tags) make it easier to categorize content and browse ie. through different articles from the same category.


Installation

Quick Start

In order to start using Tailwind simply download our starter.

DOWNLOAD ZIP STARTER

Tailwind Elements does not change or add any CSS to the already one from TailwindCSS.

You can directly copy our components into your Tailwind design and they will work straight away.

In some dynamic components (like dropdowns or modals) we add Font Awesome icons and custom JavaScript. However, they do not require any additional installation, all the necessary code is always included in the example and copied to any Tailwind project - it will work.


MDB GO


Customization

Basic example
HTML
<div class="flex flex-wrap justify-center">
  <span
    class="flex justify-center items-center m-1 font-medium py-1 px-2 bg-white rounded-full text-gray-700 bg-gray-100 border border-gray-300"
  >
    <span class="text-xs font-normal leading-none max-w-full flex-initial"
      >Hello!</span
    >
  </span>
  <span
    class="flex justify-center items-center m-1 font-medium py-1 px-2 bg-white rounded-full text-blue-700 bg-blue-100 border border-blue-300"
  >
    <span class="text-xs font-normal leading-none max-w-full flex-initial"
      >Hello!</span
    >
  </span>
  <span
    class="flex justify-center items-center m-1 font-medium py-1 px-2 bg-white rounded-full text-pink-700 bg-pink-100 border border-pink-300"
  >
    <span class="text-xs font-normal leading-none max-w-full flex-initial"
      >Hello!</span
    >
  </span>
  <span
    class="flex justify-center items-center m-1 font-medium py-1 px-2 bg-white rounded-full text-purple-700 bg-purple-100 border border-purple-300"
  >
    <span slot="avatar">
      <span
        class="flex relative w-4 h-4 bg-orange-500 justify-center items-center m-1 mr-2 ml-0 my-0 text-xs rounded-full"
        ><img
          class="rounded-full"
          alt="A"
          src="https://randomuser.me/api/portraits/women/68.jpg"
        />
      </span>
    </span>
    <span
      class="text-xs font-normal leading-none max-w-full flex-initial"
    >
      Hello!</span
    >
  </span>
  <span
    class="flex justify-center items-center m-1 font-medium py-1 px-2 bg-white rounded-full text-red-100 bg-red-700 border border-red-700"
  >
    <span class="text-xs font-normal leading-none max-w-full flex-initial"
      >Hello!</span
    >
  </span>
  <span
    class="flex justify-center items-center m-1 font-medium py-1 px-2 bg-white rounded-full text-orange-100 bg-orange-700 border border-orange-700"
  >
    <span class="text-xs font-normal leading-none max-w-full flex-initial"
      >Hello!</span
    >
  </span>
  <span
    class="flex justify-center items-center m-1 font-medium py-1 px-2 bg-white rounded-full text-green-700 bg-green-100 border border-green-300"
  >
    <span class="text-xs font-normal leading-none max-w-full flex-initial"
      >Hello!</span
    >
  </span>
  <span
    class="flex justify-center items-center m-1 font-medium py-1 px-2 bg-white rounded-full text-indigo-100 bg-indigo-700 border border-indigo-700"
  >
    <span class="text-xs font-normal leading-none max-w-full flex-initial"
      >Hello!</span
    >
    <span class="flex flex-auto flex-row-reverse">
      <span>
        <svg
          xmlns="http://www.w3.org/2000/svg"
          width="100%"
          height="100%"
          fill="none"
          viewBox="0 0 24 24"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          class="feather feather-x cursor-pointer hover:text-indigo-400 rounded-full w-4 h-4 ml-2"
        >
          <line x1="18" y1="6" x2="6" y2="18"></line>
          <line x1="6" y1="6" x2="18" y2="18"></line>
        </svg>
      </span>
    </span>
  </span>
  <span
    class="flex justify-center items-center m-1 font-medium py-1 px-2 bg-white rounded-full text-yellow-100 bg-yellow-700 border border-yellow-700"
  >
    <span slot="avatar">
      <svg
        xmlns="http://www.w3.org/2000/svg"
        width="100%"
        height="100%"
        fill="none"
        viewBox="0 0 24 24"
        stroke="currentColor"
        stroke-width="2"
        stroke-linecap="round"
        stroke-linejoin="round"
        class="feather feather-heart w-3 mr-1"
      >
        <path
          d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"
        ></path>
      </svg>
    </span>
    <span
      class="text-xs font-normal leading-none max-w-full flex-initial"
    >
      Hello!</span
    >
    <span class="flex flex-auto flex-row-reverse">
      <span>
        <svg
          xmlns="http://www.w3.org/2000/svg"
          width="100%"
          height="100%"
          fill="none"
          viewBox="0 0 24 24"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          class="feather feather-x cursor-pointer hover:text-yellow-400 rounded-full w-4 h-4 ml-2"
        >
          <line x1="18" y1="6" x2="6" y2="18"></line>
          <line x1="6" y1="6" x2="18" y2="18"></line>
        </svg>
      </span>
    </span>
  </span>
</div>
Enter fullscreen mode Exit fullscreen mode
Chips large solid color
HTML
<div class="flex space-x-2">
  <span
    class="text-xs px-3 font-medium text-base bg-gray-500 text-white rounded-full py-1.5"
  >
    Badge
  </span>
  <span
    class="text-xs px-3 font-medium text-base bg-red-500 text-white rounded-full py-1.5"
  >
    Badge
  </span>

  <span
    class="text-xs px-3 font-medium text-base bg-yellow-500 text-white rounded-full py-1.5"
  >
    Badge
  </span>
  <span
    class="text-xs px-3 font-medium text-base bg-green-500 text-white rounded-full py-1.5"
  >
    Badge
  </span>

  <span
    class="text-xs px-3 font-medium text-base bg-blue-500 text-white rounded-full py-1.5"
  >
    Badge
  </span>
  <span
    class="text-xs px-3 font-medium text-base bg-purple-500 text-white rounded-full py-1.5"
  >
    Badge
  </span>
  <span
    class="text-xs px-3 font-medium text-base bg-indigo-500 text-white rounded-full py-1.5"
  >
    Badge
  </span>
  <span
    class="text-xs px-3 font-medium text-base bg-pink-500 text-white rounded-full py-1.5"
  >
    Badge
  </span>
</div>
Enter fullscreen mode Exit fullscreen mode

You can see more customization examples on the ๐Ÿ“„ Chips documentation page


Crucial Resources

Here are the resources that we have prepared to help you work with this component:

  1. Read ๐Ÿ“„ Chips documentation page <-- start here
  2. In to get the most out of your project, you should also get acquainted with other Components options related to Chips. See the section below to find the list of them.
  3. After finishing the project you can publish it with CLI in order to receive ๐Ÿ’ฝ Free hosting (beta)

Related Components options & features


Additional resources

Learn web development with our learning roadmap:
๐ŸŽ“ Start Learning

Join our mailing list & receive exclusive resources for developers
๐ŸŽ Get gifts

Join our private FB group for inspiration & community experience
๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Ask to join

Support creation of open-source packages with a STAR on GitHub
GitHub stars

Top comments (0)