Tailwind CSS Chips

Get started on your web projects with our Tailwind CSS chip which is a compact elements that represent an input, attribute, or action. This element appears dynamically as a group of multiple interactive elements and allows users to enter information, make selections, filter content, or trigger actions.

See below our simple chip component example that you can use for your Tailwind CSS project.


chip

Chips Variants

Use this example to create a simple and versatile badge component.

chip filled
chip gradient

Chips Colors

The Chip component comes with 19 different colors that you can change it using the color class, below there are some examples of the colors

blue
red
green
amber
pink
indigo
purple
teal
cyan

Chips with Icon

Use this example to create a simple and versatile badge component.

downloads

Chips Dismissible

You can make a chip dismissible by adding the data-dismissible="chipName" data attribute to the chip element and the data-dismissible-target="chipName" data attribute to the element that you want to close the chip with.

Dismissible

Chips with Avatar

Use the example below for a chip containing an avatar.

tania andrew

Tania Andrew


Chip Data Attributes

The following data attributes are available for chip element.

AttributeDescription
data-dismissibleSet the chip dismissible name, it should be the same as the
data-dismissible-target data attribute.

Chip Trigger Data Attributes

The following data attributes are available for chip trigger element (The element that you want to close the chip with).

AttributeDescription
data-dismissible-targetHide the chip element that has the same value of data-dismissible-target
data attribute for it's data-dismissible data attribute.

Required Scrips

The chip component needs a required script file to work, you just need to add the below script file to the bottom of your html file.

<!-- from node_modules -->
<script src="node_modules/@material-tailwind/html@latest/scripts/dismissible.js"></script>
 
<!-- from cdn -->
<script src="https://unpkg.com/@material-tailwind/html@latest/scripts/dismissible.js"></script>
Edit this page on Github