Use this example to create user-friendly buttons with icon for your Tailwind CSS and React project.
The IconButton
component comes with 4 different variants that you can change it using the variant
prop.
The IconButton
component comes with 3 different sizes that you can change it using the size
prop.
The IconButton
component comes with 19 different colors that you can change it using the color
prop.
You can turn on/off the ripple effect for the IconButton
component using the ripple
prop.
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"
/>