Tailwind CSS Icon Button - React

Use this example to create user-friendly buttons with icon for your Tailwind CSS and React project.



Icon Button Variants

The IconButton component comes with 4 different variants that you can change it using the variant prop.


Icon Button Sizes

The IconButton component comes with 3 different sizes that you can change it using the size prop.


Icon Button Colors

The IconButton component comes with 19 different colors that you can change it using the color prop.


Icon Button Ripple Effect

You can turn on/off the ripple effect for the IconButton component using the ripple prop.


Font Awesome CDN Link

In case of using icon fonts rather than svg icons please add their cdn links to your project, if you're using font awesome you can use the below cdn link.

<link
  rel="stylesheet"
  href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css"
  integrity="sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w=="
  crossorigin="anonymous"
  referrerpolicy="no-referrer"
/>
Edit this page on Github