Animated Component Libraries (Magic UI, Aceternity UI): Copy-In Motion and When It Becomes Noise
Magic UI and Aceternity UI give you motion you copy into your project as one plain React and Tailwind file. Four of them on a sample page (marquee at 36 s, spotlight card on CSS variables, animated beam with curvature -40, text reveal with a 0.15 s delay), then the Too much page and three rules.
What you will learn
- Explain copy-in components: one file you own, built on React, Tailwind and shadcn/ui
- Use a marquee, a spotlight card, an animated beam and a text reveal, and know the one prop that changes each mood
- See why the spotlight card writes the pointer into CSS variables instead of React state
- Apply three rules so motion stays premium: one moving thing per screen, slow and subtle, respect reduced motion
Before you start
- React components and props
- Tailwind CSS basics
Libraries like Magic UI and Aceternity UI give you ready-made motion that you copy straight into your project. We'll look at four of them, a marquee, a spotlight card, an animated beam and a text reveal, and then at the moment they turn into noise. This is a short, optional lesson about foundations. AI can generate these effects; you need to know what each one does so you can judge what it gives you.
Not a package: copy-in components
Think of it as three small steps, not something you install:
- Browse the gallery and pick an effect.
- Copy one file into your
componentsfolder. - It's yours now. Plain React and Tailwind, so you can change anything.
Both libraries sit on top of Tailwind and shadcn/ui, so there's nothing new to learn twice. The sample project is React 19 with Vite, TypeScript and Tailwind CSS 4, with the four components in src/components.
1. Marquee: an endless row that pauses on hover
An endless row of logos that keeps sliding past. The sample page has two rows going in opposite directions:
<Marquee duration={36}><LogoSet /></Marquee>
<Marquee reverse duration={44}><LogoSet /></Marquee>
duration is the seconds for one full loop. The same component gives a different mood just by changing the duration or the direction: slower reads as calm. It pauses on hover (pauseOnHover is on by default) and fades at both edges with a CSS mask. With reduced motion, it renders a single static copy instead of the moving ones.
2. Spotlight card: a light that follows your pointer
Move the pointer over a card, and a soft light follows it while the border catches the glow. You wrap any content in it:
<SpotlightCard key={f.t} className="min-h-56">
{/* icon */}
<h3 className="font-display text-xl font-semibold text-white">{f.t}</h3>
<p className="mt-2 leading-relaxed text-neutral-400">{f.d}</p>
</SpotlightCard>
Here's the trick, from SpotlightCard.tsx:
// The pointer position goes straight into CSS variables: no React re-render per mouse move.
const move = (x: number, y: number) => {
ref.current?.style.setProperty('--x', `${x}px`)
ref.current?.style.setProperty('--y', `${y}px`)
}
// ...
onPointerMove={(e) => {
const r = e.currentTarget.getBoundingClientRect()
move(e.clientX - r.left, e.clientY - r.top)
}}
The light is a radial gradient positioned at var(--x) var(--y). Because the position lives in CSS variables, React doesn't re-render on every move, and that's why it stays smooth.
3. Animated beam: a light that travels between icons
Three sources on the left, one hub in the middle, three outputs on the right, and a light travelling between them. You give each beam a container, a from icon and a to icon:
<AnimatedBeam containerRef={box} fromRef={l1} toRef={hub} curvature={-40} duration={d} />
<AnimatedBeam containerRef={box} fromRef={l2} toRef={hub} duration={d} delay={0.3} />
<AnimatedBeam containerRef={box} fromRef={l3} toRef={hub} curvature={40} duration={d} delay={0.6} />
curvature={-40} bends the beam. It measures the icons on the page, so the beam follows your layout. You don't need to memorise how it's built.
4. Text reveal: words that fade in one by one
<TextReveal trigger="load" delay={0.15} text="Four small components that make an interface feel alive." />
The trigger is load, with a 0.15-second delay, then the text. It respects reduced motion too: if someone turns animation off, the text simply appears.
All four read the same small hook:
const QUERY = '(prefers-reduced-motion: reduce)'
function subscribe(cb: () => void) {
const mql = window.matchMedia(QUERY)
mql.addEventListener('change', cb)
return () => mql.removeEventListener('change', cb)
}
/** true when the user asked their OS for less motion. Updates live. */
export function useReducedMotion() {
return useSyncExternalStore(subscribe, () => window.matchMedia(QUERY).matches, () => false)
}
Everything moving is nothing noticed
The sample project has a Too much page: the same page with every component running at once. Marquees, glowing cards, beams, text fading in again and again. Where should you look? No single piece is wrong. Together, they fight for attention. Three rules:
- One moving thing per screen. Let one effect lead.
- Slow and subtle. Calm reads as premium.
- Respect reduced motion. Some people turn animation off.
Quick recap
| Component | What it does | The knob |
|---|---|---|
| Marquee | Endless row, pauses on hover | duration, reverse |
| SpotlightCard | Light follows the pointer | pointer in --x/--y |
| AnimatedBeam | Light travels between two elements | curvature, delay |
| TextReveal | Words fade in one by one | trigger, delay |
Try it yourself
Run the sample project and open the Too much page. Change the marquee duration and feel how the mood changes. Then pick one component for Orbit, the sample team project app, and leave the rest out. The project files and prompts are in the community, free to join.
Related course on Udemy
The Python Architect Masterclass: Full Stack to AI Engineer
Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)Related posts
Backend vs Frontend: What Runs Where, and Why the Server Is the One You Trust
Every web app has two halves. The front end runs on the user's device and is trusted with nothing; the back end holds the data, the secrets and the rules. Checked with real requests to a Django blog.
One Request, Two Answers: the Same Post as an HTML Page and as JSON
Ask a Django blog for the same post twice: once as a 12,731-byte HTML page built by a template, once as 2,976 bytes of JSON built by a serializer. Compare the headers, see who builds the page, and why the server still owns every write.
A Blog Design from a Prompt: Downloading Figma Make Code and Reading App.tsx and BlogCard.tsx
Make a blog design from a prompt in Figma Make, download src.zip, unzip it with Python's zipfile module, and read the two files that matter: App.tsx with its selectedPost state and BlogCard.tsx with its props.
How a Web Page Works: HTML Tags, Elements and Attributes
A web page is a text file full of labelled pieces. Learn tags, attributes and nesting with three tiny pages, and see what breaks when an attribute or a closing tag is wrong.
