Tutorials
How to put an effect on a real site: by pasting it into Webflow, by handing it to an AI, or by wiring the two files yourself. Pick a chapter on the left.
Webflow
Copy, paste, preview. The paste brings the section, its classes, its images and its code.
Before you pasteAdd Instrument Sans and Geist Mono to your site fonts: Site settings, Fonts, Google Fonts. Webflow removes any font the site has not installed.
Copy the component
- Open the component page and its With Webflow tab.
- Click Copy to Webflow.
Paste it
- Open your page in the Designer.
- In the Navigator, select Body, then press Cmd + V (Ctrl + V on Windows).
- The Navigator shows what arrived: the section, its images, its Code Embed.
See it run
- On the canvas the section stays still: the Designer does not run custom code.
- Click Preview.
- Turn on Enable custom code?
- Move the cursor: the effect runs.
Swap the images
For effects that show pictures, like the pixel trail. The paste brings the pictures of the preview: replace them with yours.
- In the Navigator, open Trail images (swap them here) and select an image.
- In Settings, click Replace Image… and choose yours.
Any number of images works, from one up. That div is hidden on the page: it is a store of pictures, not a gallery.
Tune it
- Select the section.
- In Settings, under Custom attributes, click +.
- Fill Name, then Value: for example
data-widthand60px.
Every component page lists its settings in its With Webflow tab, with what each one does. An attribute on the section wins over the values written in the code.
On your own elements
Some effects play on a title, an image or a section of yours. They are carried by one custom attribute, added the same way as in Step 5. The component page gives its name and the values it takes.
| Custom attribute | What it does |
|---|---|
| data-pixel-reveal | On a heading or a paragraph: the pixel reveal plays on it. |
| data-pixel-swap | On an image box: the pixel swap plays on it. Leave the value empty. |
| data-text-scramble="scroll" | On a text: the scramble plays on it. The value is the trigger, scroll or hover. |
The Code Embed has to stay on the page: it holds the code the attribute calls.
On several pages
The code ships inside the Code Embed, and that is all one page needs. To run the same effect on several pages, move the code to the site instead:
- Copy the block of Step 2: Add custom CSS of the component page into Site settings, Custom code, Head code.
- Copy the block of Step 3: Add custom JS into Footer code.
- Delete the Code Embed from the pasted section: the same code in two places runs twice.
For one page only, the same two blocks go in the page settings, under Custom code.
AI
One prompt is the whole handover. It works in a chat window and in a coding agent.
Copy the prompt
- Open the component page and its With AI tab.
- Click Copy the AI prompt.
- It carries the code, the markup, every setting and the pitfalls. Nothing to attach.
Answer two questions
Paste the prompt into your assistant. Before writing any code, it asks:
- Do you want it exactly as in the preview, or only the effect on your own content?
- Where is it going: plain HTML, Webflow, React, Astro?
A coding agent that can see your project finds the second answer by itself. If you only want the effect, name the element that gets it and the images to use.
Change what you like
Another timing, a different structure, one part only: ask for it. The prompt tells the assistant how the engine works and what breaks it.
Code
One stylesheet, one script, no build step. It runs in the browser only.
Take the files
- Open the component page and its Code tab.
- Click Download the code: the files and their pictures.
- Add the tags of Step 1: stylesheet in the head, script before the closing body tag.
Some components also need GSAP or Matter.js. When one does, its page gives the tag.
Mark the element
The script looks for one data attribute when the page is ready, and mounts itself on every element that carries it. For the pixel trail:
<section data-pixel-trail> … </section>
The complete markup is at Step 2 of the Code tab.
Drive it from JavaScript
Only when the page changes after it has loaded, or when you want to hear from the effect. Taking the pixel trail:
// content added later, by a fetch, a router or a CMS
PixelTrail.auto(container);
// one element, by hand
const trail = PixelTrail.mount(element);
trail.destroy();
// what the effect reports
element.addEventListener('pixeltrail:spawn', (event) => {
console.log(event.detail);
});
The names of each component are in the step Drive it from JavaScript of its Code tab.
Change a setting
Three places, and the most precise one wins:
- On one element: a data attribute, for example
data-hold="3". - For the page:
window.PixelTrailSettings, declared before the script. - For good:
DEFAULTS, at the top of the JS file.
Questions
Short answers about the paste, the limits and the plans.
- Nothing moves on the canvas. Is the paste broken?
- No. The Designer does not run custom code. Open Preview with Enable custom code? turned on, or the published site.
- Do the images come with the paste?
- Yes, the ones of the preview. Replace them with yours in the Settings panel.
- Can I put the code in two places?
- No. The same code in two places runs twice. Keep the Code Embed, or the site code, not both.
- Can I delete the section that came with the paste?
- Yes, once your own element carries the attribute and the code is still on the page. An effect that fills a whole section, like the pixel trail, keeps a section: mark yours before deleting ours.
- Is there room for all that code?
- Webflow allows 50 000 characters per Embed. Our biggest one is around 40 500, unminified, comments included. The button pack is larger and arrives in two Embeds.
- Does this need a paid plan?
- On a free site the paste lands and plays in Preview. Editing the Code Embed and using the custom code fields need a site plan.