|
1 |
| -# TailwindCSS Animate |
| 1 | +# @iscodex/tailwindcss-animate |
| 2 | + |
| 3 | +Extended animation utilities for Tailwind CSS v4. Modern, lightweight, and fully customizable animations built with CSS custom properties. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Tailwind CSS v4 Native** - Built with `@utility` and `@theme` syntax |
| 8 | +- **Zero Configuration** - Just import and start animating |
| 9 | +- **Fully Customizable** - Control duration, delay, timing, and more |
| 10 | +- **CSS Custom Properties** - Easy theming and dynamic control |
| 11 | +- **Modular Architecture** - Import only what you need |
| 12 | +- **TypeScript Support** - Complete type definitions included |
| 13 | + |
| 14 | +## Installation |
| 15 | + |
| 16 | +```bash |
| 17 | +npm install @iscodex/tailwindcss-animate |
| 18 | +``` |
| 19 | + |
| 20 | +## Quick Start |
| 21 | + |
| 22 | +Add the import to your CSS file: |
| 23 | + |
| 24 | +```css |
| 25 | +@import "tailwindcss"; |
| 26 | +@import "@iscodex/tailwindcss-animate"; |
| 27 | +``` |
| 28 | + |
| 29 | +Start using animations: |
| 30 | + |
| 31 | +```html |
| 32 | +<div class="animate-wiggle">Hello World!</div> |
| 33 | + |
| 34 | +<button class="animate-bounce animate-infinite animate-duration-[2s]"> |
| 35 | + Click me |
| 36 | +</button> |
| 37 | +``` |
| 38 | + |
| 39 | +## Requirements |
| 40 | + |
| 41 | +- **Tailwind CSS v4.0.0** or higher |
| 42 | +- Modern browser with CSS custom properties support |
| 43 | + |
| 44 | +## Available Animations |
| 45 | + |
| 46 | +### Attention Seekers |
| 47 | + |
| 48 | +- `animate-flash` - Flashing effect |
| 49 | +- `animate-head-shake` - Head shake movement |
| 50 | +- `animate-heart-beat` - Heart beating effect |
| 51 | +- `animate-jello` - Jello wobble effect |
| 52 | +- `animate-rubber-band` - Rubber band stretch |
| 53 | +- `animate-shake-x` - Horizontal shake |
| 54 | +- `animate-shake-y` - Vertical shake |
| 55 | +- `animate-swing` - Pendulum swing |
| 56 | +- `animate-tada` - Celebration effect |
| 57 | +- `animate-wiggle` - Gentle rotation wiggle |
| 58 | +- `animate-wobble` - Side-to-side wobble |
| 59 | + |
| 60 | +### Dashing Animations |
| 61 | + |
| 62 | +- `animate-dash-in-left` - Fast slide in from left |
| 63 | +- `animate-dash-in-right` - Fast slide in from right |
| 64 | +- `animate-dash-out-left` - Fast slide out to left |
| 65 | +- `animate-dash-out-right` - Fast slide out to right |
| 66 | + |
| 67 | +### Bouncing Effects |
| 68 | + |
| 69 | +- `animate-bounce-in` - Bounce entrance |
| 70 | +- `animate-bounce-in-down` - Bounce in from top |
| 71 | +- `animate-bounce-in-up` - Bounce in from bottom |
| 72 | +- `animate-bounce-out` - Bounce exit |
| 73 | + |
| 74 | +### Rotating Effects |
| 75 | + |
| 76 | +- `animate-rotate-in` - Rotating entrance |
| 77 | +- `animate-rotate-out` - Rotating exit |
| 78 | + |
| 79 | +### Special Effects |
| 80 | + |
| 81 | +- `animate-hinge` - Door hinge effect |
| 82 | +- `animate-jack-in` - Pop-up like jack-in-the-box |
| 83 | +- `animate-jack-out` - Reverse jack-in effect |
| 84 | + |
| 85 | +_And many more..._ |
| 86 | + |
| 87 | +## Control Utilities |
| 88 | + |
| 89 | +### Duration |
| 90 | + |
| 91 | +```html |
| 92 | +<div class="animate-wiggle animate-duration-[500ms]">Fast wiggle</div> |
| 93 | +<div class="animate-bounce animate-duration-[2s]">Slow bounce</div> |
| 94 | +``` |
| 95 | + |
| 96 | +### Delay |
| 97 | + |
| 98 | +```html |
| 99 | +<div class="animate-fade-in animate-delay-[1s]">Delayed entrance</div> |
| 100 | +``` |
| 101 | + |
| 102 | +### Iteration Count |
| 103 | + |
| 104 | +```html |
| 105 | +<div class="animate-pulse animate-infinite">Never stops</div> |
| 106 | +<div class="animate-bounce animate-twice">Bounce twice</div> |
| 107 | +``` |
| 108 | + |
| 109 | +### Direction |
| 110 | + |
| 111 | +```html |
| 112 | +<div class="animate-spin animate-reverse">Reverse spin</div> |
| 113 | +<div class="animate-wiggle animate-alternate animate-infinite"> |
| 114 | + Back and forth |
| 115 | +</div> |
| 116 | +``` |
| 117 | + |
| 118 | +### Fill Mode |
| 119 | + |
| 120 | +```html |
| 121 | +<div class="animate-fade-in animate-fill-both">Maintains final state</div> |
| 122 | +``` |
| 123 | + |
| 124 | +### Timing Functions |
| 125 | + |
| 126 | +```html |
| 127 | +<div class="animate-bounce animate-ease-in-out">Smooth bounce</div> |
| 128 | +``` |
| 129 | + |
| 130 | +### Composition |
| 131 | + |
| 132 | +```html |
| 133 | +<div class="animate-bounce animate-wiggle animate-add">Combined animations</div> |
| 134 | +``` |
| 135 | + |
| 136 | +## CSS Custom Properties |
| 137 | + |
| 138 | +Customize animations globally using CSS custom properties: |
| 139 | + |
| 140 | +```css |
| 141 | +:root { |
| 142 | + --default-animation-duration: 0.5s; |
| 143 | + --default-animation-delay: 0s; |
| 144 | + --default-animation-timing-function: ease-in-out; |
| 145 | +} |
| 146 | + |
| 147 | +/* Theme-specific customization */ |
| 148 | +.dark { |
| 149 | + --default-animation-duration: 0.8s; |
| 150 | +} |
| 151 | +``` |
| 152 | + |
| 153 | +## Advanced Usage |
| 154 | + |
| 155 | +### Hover Animations |
| 156 | + |
| 157 | +```html |
| 158 | +<button class="hover:animate-wiggle transition-all">Hover to wiggle</button> |
| 159 | +``` |
| 160 | + |
| 161 | +### Responsive Animations |
| 162 | + |
| 163 | +```html |
| 164 | +<div class="animate-bounce md:animate-fade-in lg:animate-none"> |
| 165 | + Responsive animation |
| 166 | +</div> |
| 167 | +``` |
| 168 | + |
| 169 | +### Custom Duration with Arbitrary Values |
| 170 | + |
| 171 | +```html |
| 172 | +<div class="animate-spin animate-duration-[3.5s]">Custom timing</div> |
| 173 | +``` |
| 174 | + |
| 175 | +## Contributing |
| 176 | + |
| 177 | +Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details. |
| 178 | + |
| 179 | +## License |
| 180 | + |
| 181 | +MIT License - see [LICENSE](LICENSE.md) file for details. |
| 182 | + |
| 183 | +## Changelog |
| 184 | + |
| 185 | +See [CHANGELOG.md](CHANGELOG.md) for version history. |
| 186 | + |
| 187 | +## Links |
| 188 | + |
| 189 | +- [Documentation](https://tailwindcss-animate-docs.com) _(coming soon)_ |
| 190 | +- [Animation Configurator](https://tailwindcss-animate.com/configurator) _(coming soon)_ |
| 191 | +- [GitHub Repository](https://github.com/iscodex/tailwindcss-animate) |
| 192 | +- [npm Package](https://www.npmjs.com/package/@iscodex/tailwindcss-animate) |
| 193 | + |
| 194 | +--- |
| 195 | + |
| 196 | +Made with ❤️ by [@iscodex](https://github.com/iscodex) |
0 commit comments