How to use it
Two ways in. Pick the one that fits you. Neither needs an account.
1. Copy the code
Best if your project uses React (Next.js, Vite, Remix, Astro with React).
- Open a piece in the library and look at the Needs line. If it says
npm install motion, run that in your project folder first. - Open the Code tab. Most pieces have two files: a component (
.tsx) and its styles (.css). Create both files in the same folder, for examplecomponents/MagneticButton.tsxandcomponents/magnetic-button.css, and paste the code in. - Import the component where you want it and use it:
import { MagneticButton } from "@/components/MagneticButton";
export default function Page() {
return <MagneticButton>Get started</MagneticButton>;
}Using JavaScript instead of TypeScript? Rename .tsx to .jsx and delete the lines that start with type, plus anything after a colon inside the function brackets. Or paste the file into an AI tool and ask it to convert it.
2. Copy the AI prompt
Best if you use another framework, a site builder, or you don't write code yourself.
- On any piece, press Copy AI prompt.
- Paste it into ChatGPT, Claude, Cursor, v0, Lovable, Bolt or any other AI tool.
- Add one line at the end saying what you use, for example: “Build this in plain HTML, CSS and JavaScript in one file.”
Each prompt describes the layout, the motion, the exact colors and spacing, and the accessibility rules, and it includes the original code as a reference. That is why the result looks like the preview instead of a rough guess.
The AI prompts shelf goes one step further: fill in a short form and get a complete prompt for a whole landing page.
3. Which framework should I pick?
- Never built a site before? Use an AI tool with the AI prompt and ask for plain HTML, CSS and JavaScript in one file. You can open it straight in your browser.
- Want a real project you can grow? Next.js. Every GiftUI piece works in it as-is, and Cloudflare Pages or Vercel host it for free.
- Already use Vue, Svelte, Angular or WordPress? Keep it. Use the AI prompt and name your framework.
4. Adding your images
Some pieces, like the portfolios, show photos. Until you add your own, they show a colored placeholder, so nothing ever looks broken.
- Put your image in your project's
public/images/folder. - In the component, find the line with
/images/…and change the filename to yours. Keep the shape similar (the piece page says if it wants landscape or portrait). - Write a short, real description in the image's alt text, for people using screen readers.
Need an image? Ask an image AI for it, and say “no text in the image” so it doesn't invent fake letters.
5. Changing colors
Every piece keeps its colors as variables at the top of its CSS file, for example --accent: #ff5a1f;. Change them there and the whole piece follows. Keep enough contrast: light text on dark colors, dark text on light colors.
6. Stuck?
Paste the piece's code and your error message into an AI tool and ask “why doesn't this work?”. It fixes most problems in one try. Still stuck, or found a bug? Open an issue on GitHub and describe what happened.