How to add custom code and animation to Framer
Three ways to add HTML, CSS and JavaScript to Framer: the Embed component, Custom Code in settings and code components. Plus how to drop in a ready animated element.

Framer has plenty of built-in motion, but sometimes you need an effect it does not offer: a shader background, a complex button, an interactive widget. That is where custom code helps.
Way 1. The Embed component
- Open the Insert menu and search for Embed.
- Drag it onto the canvas and set its size.
- Switch to HTML mode and paste the code.
- Publish and check the live page.

Way 2. Custom Code in site settings
Site settings have a Custom Code section for scripts and styles on every page or on one page, for example analytics or a shared animation script.
Way 3. Code components
If you know React or work with an AI, create a code component. It behaves like any Framer component: drag it, edit props in the right panel, reuse it.
Worth knowing
- Some sites forbid iframe embedding, then Embed shows a blank space.
- Give Embed an explicit height or it may collapse.
- Check on the published site and on a phone.
Ready components
Components from our catalog come with a separate Framer embed, one block for Embed. To turn one into a code component, the archive includes a prompt for Claude, ChatGPT or Cursor.





