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.
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.
- Filter by category: Headers, Menus & Navigation, Controls, Feedback & Status, Cards & Groups, or Bento & Features.
- Press Play on the card. Each card plays in place.
- Click View to open the popup. It shows a description, the Customize controls, a Copy menu and the track and layer count, with an option to show the values.
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:
| Format | Use it when |
|---|---|
| React (a .jsx component) | You want the component in a React app as is |
| LLM prompt | You want a model to rewrite it for your stack |
| HTML / CSS | You 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.
- Copy if you already have an empty component file open in your editor.
- Download if you want a .jsx file to move into your project, or to attach to a pull request or ticket so a reviewer can see where it came from.
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
- Put the file in your components folder, for example
src/components/. Rename it to match your project's naming if needed. - 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.
- Import it where you need it and render it.
- 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:
- Size. The card was designed at a size in the gallery. Put it in a container of a sensible width and check it at mobile width too.
- Background. If you set a background in Customize, it carries into the export. Make sure it matches the surface it sits on in your app, or set it again and re-export.
- Reduced motion. Decide what the component does when the user has asked for less motion. Usually that is a short fade or the final state with no movement. See the prefers-reduced-motion guide.
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
| Situation | Route |
|---|---|
| Plain React, you want it working today | React export, as is |
| Tailwind, Framer Motion or TypeScript required | LLM prompt, with your rules added |
| You want to study the motion first | HTML / CSS, opened in a browser |
| A designer will adjust it before you build | JSON (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.
