Tutorials

From the animation gallery to a React component

Pick a gallery card, customize it, copy or download it as a React .jsx component and drop it into your app, or adapt it to Tailwind or Framer Motion.

· 5 min read

If you build in React, the Capture Motion gallery can save you an afternoon. Each card is a crafted animation, and the Copy menu turns it into a .jsx component with your changes already applied. This tutorial goes from picking a card to seeing it run in your own app, and covers what to do when your project uses Tailwind or Framer Motion.

Step 1: pick a card

Start with the motion you need, not the colour you see. Colour and text are easy to change later.

The track and layer count is worth a look before you commit. A card with a handful of tracks is a light component. A card with many layers, or a 3D card built with three.js such as Glass Switch, is a bigger piece of work to own. Both are fine; it helps to know which you are taking on.

Step 2: customize it

Make your changes in the popup before you export. The controls depend on the card. Typical ones are a liquid or accent colour, the background, the speed and the label text.

Your choices carry into the React export: colour re-tints, text swaps, speed and background. That means you are not hunting through the component for hex values and strings afterwards. If you change too much, Reset takes the controls back to the card's starting values.

Customizing and exporting a gallery animation covers each control and how it carries into every format.

Step 3: copy or download React

Open the Copy menu. It has four formats, each with Copy and Download:

FormatUse it when
React (a .jsx component)You want the component in a React app as is
LLM promptYou want a model to rewrite it for your stack
HTML / CSSYou want a working page to check or to lift CSS from
JSON (for Figma)A designer needs it as a Figma Motion timeline

For this tutorial, choose React.

If you want to come back to the same version later, use Save to My Gallery as well. It saves the card with your Customize choices to My Gallery.

Step 4: drop it into your app

  1. Put the file in your components folder, for example src/components/. Rename it to match your project's naming if needed.
  2. Open it and read the top. Check what it exports, what it imports and whether it expects any props. If it imports a package your project does not have, install it.
  3. Import it where you need it and render it.
  4. Run your dev server and compare it with the card in the gallery, played side by side.

Here is what that usually looks like. This snippet is illustrative: the component name, file name and props are placeholders. Use the names in the file you exported.

// Illustrative only. Replace GalleryToggle and its path
// with the component your export actually contains.
import GalleryToggle from "./components/GalleryToggle";

export default function SettingsRow() {
  return (
    <div className="settings-row">
      <span>Dark mode</span>
      <GalleryToggle />
    </div>
  );
}

A few things to check once it renders:

Or adapt it with the LLM prompt

Many React projects have house rules: Tailwind for styling, Framer Motion for animation, TypeScript everywhere. The React export is a good component, but it may not follow your rules. This is where the LLM prompt helps.

Copy > LLM prompt gives you the capture JSON plus the card's own markup as a visual reference, so a model can rebuild it closely. Your Customize choices are already in it. Paste it into ChatGPT or Claude, then add your requirements. For example:

Build this as a React component in TypeScript.
Use Tailwind classes for all styling, no separate CSS file.
Use Framer Motion for the animation.
Keep every duration, delay and easing value exactly as given.
Name the component SettingsToggle and accept a "label" prop.

The line that matters most is the one about keeping the timings. Without it, a model may round 520 ms to 500 ms or swap a custom curve for easeOut, and the motion stops feeling like the card you picked.

Check the result against the gallery card side by side. If something drifts, point at the specific track: "the label's delay should be 80 ms, as in the JSON". If you are converting by hand rather than with a model, CSS keyframes to Framer Motion shows how keyframes, durations and easing map across. Recreating an animation with Claude has more prompt tips.

Which route to take

SituationRoute
Plain React, you want it working todayReact export, as is
Tailwind, Framer Motion or TypeScript requiredLLM prompt, with your rules added
You want to study the motion firstHTML / CSS, opened in a browser
A designer will adjust it before you buildJSON (for Figma), then build from their values

Whichever you pick, keep the customizing in the gallery and the integration in your code. Changing colour or text in Customize and exporting again is quicker, and less error-prone, than editing values by hand across a component you did not write.

Questions

What does the React export give me?

A .jsx component of the card, with your Customize choices for colour, text, speed and background already applied. You can copy it or download it as a file from the card's Copy menu.

Does the component use Tailwind or Framer Motion?

Open the file to see how it is built. If your project uses Tailwind or Framer Motion and you want the component written that way, use Copy > LLM prompt and ask ChatGPT or Claude to rebuild it in that style.

Should I copy or download?

Copy is quickest when you are pasting into a file you already have open. Download gives you a .jsx file to drop into your components folder or attach to a ticket.

Can I change the component after I export it?

Yes, it is your code. For colour, text, speed and background it is usually quicker to change them in Customize and export again, so the values stay consistent.