niceui

Website animation examples

Good website animations explain, guide or reward. They are never just decoration. Here are forty proven patterns grouped by what they do, each with a live example and source you can copy.

Updated · NiceUI

What makes a website animation work

Every animation on a page should answer a question for the visitor: what changed?, where should I look? or did that work? Motion that does none of those is noise. Three rules cover most cases:

  • Keep it short. 150–300 ms for interface feedback, up to about a second for an entrance. Anything longer feels slow the second time.
  • Animate transform and opacity. They run on the compositor and stay smooth even on phones. Avoid animating width, height or top.
  • Respect reduced motion. Wrap non-essential motion in prefers-reduced-motion so people who get motion sick still get the content.

1. Hero and background animations

The first screen sets the tone. A slow, drifting background adds depth without competing with the headline. Aurora gradients, light beams and animated grids are the most common, and the subtle ones age best.

2. Text animations

Animated text draws the eye to the one line you most want read. A typing effect suits developer tools, a scramble suits anything technical, and rotating words let one headline speak to several audiences.

3. Scroll animations

Scroll-driven motion turns a long page into a story. Reveal content as it enters the viewport, pin a visual while copy scrolls past, or zoom an image into the next section. Use it sparingly: two or three scroll moments per page are plenty.

4. Hover and cursor effects

Hover states tell people what is clickable. Go beyond a colour change with a magnetic pull, an underline that draws in, a spotlight that follows the pointer or a custom cursor that labels what a click will do.

5. Loading and progress animations

Waiting feels shorter when something moves. Use a small spinner for quick actions, a progress bar when you know the duration, and a shimmer or thinking indicator for AI responses.

6. Micro-interactions

Tiny responses to a click or toggle make an interface feel alive: a switch that springs, a button that confirms, confetti when someone finishes a task, a toast that stacks neatly.

7. Navigation animations

Menus that animate between states help people keep their place. Slide a highlight to the hovered link, morph a header as the page scrolls, or let a mega menu resize smoothly between sections.

How to add these to your site

Every example above is a free React and Tailwind CSS component. Open one, copy the source or install it with the shadcn CLI, and it lives in your project with no package to update:

bash
npx shadcn@latest add https://niceui.dev/r/effects-aurora-background.json

Start with one hero background, one text effect and good hover states. That alone makes most sites feel considered.

FAQ

What are the most common website animations?

Hero background motion, text reveals, scroll-triggered entrances, hover effects on buttons and cards, loading indicators and small micro-interactions such as toggles and toasts.

Do animations slow down a website?

Not when they animate transform and opacity, run only while visible and avoid large JavaScript libraries. All examples here follow those rules.

How do I make animations accessible?

Honour prefers-reduced-motion, never hide content behind animation, and keep flashing below three times per second.

Keep reading