Wix Studio 2 lets you write real React and drop it on a page like any other element. We tested that with something silly on purpose: a strip of cartoon mice that run away from your cursor, which turns into a cat. Then we built a second strip with meerkats and a falcon.

Mice that run from a cat. Meerkats that run from a falcon. Both are React components.
This post covers how we built both with Claude, the five things that broke, and the rules we'd follow next time. The video below is the full 20-minute recording of the second build.
What we built
Two full-width strips, each 800px tall, stacked on one page:
Mice and a cat. A yellow strip with 20 mice. Hover it and your cursor becomes a cat. Mice inside a set distance run. Click and the cat pounces.
Meerkats and a falcon. A blue strip. A meerkat that stops stands up like a lookout. A running one drops to all fours.
Touch works too. On a phone, the animals run from your finger.
Settings in the editor. Number of animals, how close the hunter gets before they bolt, and strip height.
Every animal is drawn in code as SVG. There are no image files and no animation library.
Have a play
Both strips are live below. Move your cursor over them, or tap if you're on a phone. Click to pounce.
These two run as plain embeds so they work inside a blog post. They use the same drawings and the same movement rules as the React components on the Studio 2 page.
Why does this need Wix Studio 2?
Studio 2 has a Code tab that is VS Code running in the browser, and it takes standard React. Wix's recommended way to build custom UI there is an Editor React Component, or ERC. You write a React component, and the editor gives it a settings panel and lets you place it on a page.
Wix's own docs say Editor React Components aren't supported on Wix Editor or Wix Studio sites. On those you'd reach for a custom element instead. Wix also labels parts of the ERC system as alpha, so expect things to move.
If you're new to the platform, start with our rundown of Wix Studio 2 features and our comparison of Wix Studio 2 vs Wix Studio.
Step 1: design it before you build it
We had Claude draw the strip as a working prototype on a design canvas first. You can hover it and watch the mice run before any site is touched.
The brief was spoken, not typed. Roughly:
Design a strip with around 20 cartoon mice scattered on it. When I hover over the strip, the cursor changes into a cartoon cat and the mice avoid it. Use React so we can put it on Wix Studio 2.
Changing a drawing on a canvas takes seconds. Changing a built component means a rebuild. So agree the look first.
Step 2: scaffold the component in the Code tab
Switch the editor from Design to Code.
Open the Wix Extension Builder (the puzzle icon in the sidebar).
Choose Create an Extension, then Editor React Component.
Give it a name and a description, then click Generate.
You get a folder with a handful of files. Three matter day to day:
your-name.tsx is the React component.
your-name.props.ts holds the settings and their defaults.
your-name.module.css holds the styles.
Wix has a full walkthrough in Build an Editor React Component in Studio Two. This is separate from exporting a whole site as code, which we covered in Wix Studio Two React export.
Step 3: write the component
The idea is simple. Each animal has a position and a speed. Every frame, any animal inside the flee radius gets pushed directly away from the pointer.
const dx = m.x - hunter.x;
const dy = m.y - hunter.y;
const d = Math.sqrt(dx * dx + dy * dy) || 0.001;
if (d < fleeRadius) {
const f = 1 - d / fleeRadius; // closer = stronger push
ax += (dx / d) * f * 3400;
ay += (dy / d) * f * 3400;
}Three extra rules stop it looking broken:
Slide along edges. An animal pinned against a wall gets a sideways push, so it escapes instead of vibrating in a corner.
Keep apart. Animals closer than about 50px push each other away, so they don't stack.
Wander when calm. Each one potters about and pauses on its own timer.
The cursor swap is a trick. The real cursor is hidden over the strip, and a drawn cat follows the pointer. Browsers cap custom cursor images at a small size. A drawn element can be bigger and can animate.
Step 4: build it and put it on the page
In the Code tab terminal:
npx wix build && npx wix generate manifestThen reload the editor, switch back to Design, and:
Select the section above where you want the strip and click Add Section.
In the empty section, click Add an Element.
Search for your component's name and click its tile.
Click the stretch control on the element so it fills the width.
Set the section height to match the strip.
Step 5: tune it in the editor
Select the strip and open its settings. You get a slider for each setting you declared in the props file. No code needed from here.
In the recording we tried three flee distances on the meerkats. A small one gave the falcon easy catches. A large one let you sweep the whole strip clear. We also pushed the count to 100 to see if it held up. It did.
Five things that broke, and the fixes
1. The strip was 0px tall. The editor overrides height and min-height on a component's outer element. Our height was set there, so the strip vanished. Fix: put an inner block inside the component and set the height on that.
2. We couldn't set the height to 800. The editor showed every number setting as a 0 to 100 slider, and typing 800 snapped back to 100. Fix: store sizes in tens of pixels. A height of 80 means 800px.
3. The editor showed the old version after a rebuild. It picked up new code a step late. Fix: reload the editor after every build before judging the result.
4. The component landed in the footer. We clicked its tile with no section selected. It went into the site-wide footer at 0px tall, where nobody could see it. Fix: add a section, select it, then add the element.
5. Each meerkat showed both poses at once. A general style rule beat the rule that hides the running pose. Fix: make the hiding rule more specific than the general one.
One more. We asked the editor's built-in AI assistant to place the component. It said it had, twice, and the page was still empty. Check the canvas, not the chat.
How do you keep an animation like this fast and accessible?
A decorative animation should cost nothing when nobody is looking at it. Ours follows six rules:
Only run on screen. An IntersectionObserver starts the loop when the strip scrolls into view and stops it when it leaves.
Never measure inside a frame. A ResizeObserver stores the strip's size. Each frame only writes transform values.
Skip React state for positions. Positions live in refs, so 60 updates a second don't cause 60 re-renders.
Hide it from screen readers. The strip is decoration, so it carries aria-hidden.
Respect reduced motion. With that setting on, the animals stop wandering. They still move away from the pointer.
Be kind to phones. Only hide the real cursor on devices that have one, and leave vertical scrolling alone.
const io = new IntersectionObserver((entries) => {
if (entries.some((e) => e.isIntersecting)) start();
else stop();
});
io.observe(root);On the second strip we added two more. Phones get a shorter strip, and small screens show fewer animals.
How long did it take?
In the screen recording, the meerkat strip went from one spoken prompt to a working preview in about 11 minutes. The first strip took longer, because that's where we hit the five problems above. The second build reused every fix.
Want one on your site?
If you've got an idea like this for your own Wix Studio 2 site and you're not sure where to start, drop us a line. Tell us the animal.
FAQs
Can I build this in Wix Studio or the Wix Editor?
Not as an Editor React Component. Wix's docs say ERCs aren't supported there. A custom element is the route on those editors, and you'd build the settings panel yourself.
Do I need to know React?
It helps. Claude wrote the code here, but someone still has to read an error, spot a strip that is 0px tall and know where to look. If nobody on your team can do that, keep the first project small.
Will it slow my page down?
Not if it follows the rules above. Ours has no images or extra packages, and it stops completely when it's off screen.
Does it work on phones?
Yes. The animals run from a finger the same way they run from a cursor. Decide on a shorter height for mobile, because 800px is taller than most phone screens.
What would you use this for on a real site?
A pest control firm is the obvious one. It also suits a playful 404 page, a kids' brand, or a campaign page that needs one moment people remember.





