Component
Animated Icon Button
Icon animations on hover for interactive effects
- Component
- Tailwind
- MIT
Preview
Live component
9:41 100%
devsnips.dev/library/tailwind/components/buttons/animated-button/icon/ fluid · no fixed width 100%
Install
Add to your project
npx devsnips add Tailwind/Components/Buttons/animated-button/icon Tailwind/Components/Buttons/animated-button/icon <!-- Icon Button - Scale -->
<button class="group p-3 bg-blue-600 text-white rounded-full hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-all">
<svg class="w-6 h-6 transition-transform group-hover:scale-110" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"/>
</svg>
</button>
<!-- Icon Button - Rotate -->
<button class="group p-3 bg-pink-500 text-white rounded-full hover:bg-pink-600 focus:outline-none focus:ring-2 focus:ring-pink-500 transition-all">
<svg class="w-6 h-6 transition-transform group-hover:rotate-12" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/>
</svg>
</button>
<!-- Icon Button - Flip -->
<button class="group p-3 bg-green-600 text-white rounded-full hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 transition-all">
<svg class="w-6 h-6 transition-transform group-hover:-rotate-45" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"/>
</svg>
</button> # Animated Button Icon
Button with an animated icon treatment.
## Preview
Open `preview.html` for a standalone demonstration of this variant.
## Features
- Icon animation
- CSS transitions
- Focus-visible states
- Native button
## Usage
```bash
npx devsnips add Tailwind/Components/Buttons/animated-button/icon
```
Copy from `code.html`.
## Customization
- Icon and motion utilities
- Colors, padding, radius
## Accessibility
- Native `<button>`
- Decorative icons should remain `aria-hidden`
## Dependencies
- Tailwind CSS only
## File Structure
- `code.html` — copy/paste snippet
- `preview.html` — standalone demo
- `metadata.json` — metadata
- `README.md` — this file 20 lines UTF-8 · LF · Spaces: 2
Continue browsing