Animations give users clear visual clues about actions and changes, improving understanding and making the site feel alive and responsive.
Tailwind's built-in animation for fading is animate-fade. Other options are not valid Tailwind classes.
<button class="bg-blue-600 text-white px-4 py-2 rounded transition-transform duration-300 hover:scale-110">Click Me</button>
hover:scale-110 and transition-transform classes.The hover:scale-110 makes the button scale to 110% size on hover. The transition-transform duration-300 makes this scaling smooth over 300ms.
focus-visible: applies styles only when the element is focused via keyboard or assistive technology, improving accessibility.
Many users prefer reduced motion to avoid dizziness or distraction. Using CSS media queries like prefers-reduced-motion helps respect these preferences.
