Framercode
Generate production-ready Framer Code Overrides and Code Components in React/TypeScript. Use this skill whenever the user mentions Framer code, code overrides, code components, Framer property controls, Framer animations, or asks to build any interactive behavior inside Framer — even if they just say "make this element do X in Framer" or "I need a Framer component for Y." Also trigger when the user references framer-motion in a Framer context, asks about createStore for shared state, or wants to add property controls to a component. Always use this skill instead of generic React advice when the target environment is Framer.From its SKILL.md
npx -y skills add Chevis-Zhou/agent-skills --skill framercodeAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
6.8 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it
Framer Code — Overrides & Components
Role
Act as an expert Framer developer specializing in Code Overrides and Code Components. Generate correct, production-ready React/TypeScript code for Framer projects. Keep replies short and code-focused — explanations only where non-obvious logic exists.
Visual direction: when the component's look isn't already defined on the Framer canvas, run the /design skill for aesthetic direction before coding — it routes to the current specialist design skills, so upgrades propagate here automatically.
Decision: Override vs. Component
Pick the right tool for the job:
| Use a Code Override when… | Use a Code Component when… |
|---|---|
| Modifying behavior/style of an existing canvas element | Building a self-contained UI element from scratch |
| Adding hover/click/scroll interactions | Integrating a third-party library |
| Sharing state between multiple canvas elements | Needing property controls in the Framer UI |
| The visual is already designed on the canvas | The visual doesn't exist yet and is easier to code |
Code Override Rules
- Export a named function using
withFunctionNameorPascalCaseconvention. - The function receives
Componentand returns a new component that spreads...propsonto<Component>. - Never use TypeScript generics on the override function — Framer handles type checking.
- Import
ComponentTypefrom"react"for the return type annotation. - To modify CSS, destructure
stylefrom props, spread it, then override:style={{ ...style, backgroundColor: "red" }}. - For shared state across overrides, use
createStorefromhttps://framer.com/m/framer/store.js@^1.0.0. - Always include the Framer annotation block above the export.
Override template:
import type { ComponentType } from "react"
/**
* @framerDisableUnlink
* @framerIntrinsicWidth 100
* @framerIntrinsicHeight 100
*/
export function withMyOverride(Component): ComponentType {
return (props) => {
return <Component {...props} />
}
}
Code Component Rules
- Must be a single function-based
.tsxfile with inlined CSS (no separate CSS files). - The returned element can use
motionprops fromframer-motion. - Spread
props.styleonto the root element to support Framer's sizing/layout system. - Define
defaultPropsfor every property control. - Use
addPropertyControlsto expose configuration in Framer's UI panel. - Always include the Framer annotation block.
Component template:
import { motion } from "framer-motion"
import { addPropertyControls, ControlType } from "framer"
/**
* @framerDisableUnlink
* @framerIntrinsicWidth 200
* @framerIntrinsicHeight 100
* @framerSupportedLayoutWidth any
* @framerSupportedLayoutHeight any
*/
export default function MyComponent(props) {
const { text, style } = props
return (
<motion.div style={{ ...style }}>
{text}
</motion.div>
)
}
MyComponent.defaultProps = {
text: "Hello World!",
}
addPropertyControls(MyComponent, {
text: { type: ControlType.String, title: "Text" },
})
Critical Gotchas
These are the mistakes that cause silent failures in Framer — always check for them:
- Font controls: When using
ControlType.Fontwithcontrols: "extended", apply font styles by spreading...fontinto the style object. Never destructure individual font properties (props.fontFamily,props.fontSize) — they won't work. - Props spreading: Always spread
...props(overrides) orprops.style(components) to preserve Framer's layout, sizing, and positioning. - No generics on overrides:
function withX(Component): ComponentType— notwithX<T>(Component: ComponentType<T>). - Single file: Components must be a single
.tsxfile. No imports from local files. - Annotation block: Every export needs the
/** @framerDisableUnlink ... */JSDoc block or Framer may mishandle the component.
Framer Annotations Reference
| Annotation | Purpose | Values |
|---|---|---|
@framerDisableUnlink | Prevents unlinking on edit | (no value) |
@framerIntrinsicWidth | Default width in pixels | number |
@framerIntrinsicHeight | Default height in pixels | number |
@framerSupportedLayoutWidth | Width sizing options | any, auto, fixed |
@framerSupportedLayoutHeight | Height sizing options | any, auto, fixed |
Property Controls
For the full property controls reference (all control types, syntax, and examples), read:
→ references/property-controls.md
Consult that file whenever generating a component with property controls beyond basic String/Number/Boolean, or when the user asks about a specific control type.
Shared State Pattern
When multiple overrides need to communicate (e.g., a button toggles visibility of another element), use createStore:
import type { ComponentType } from "react"
import { createStore } from "https://framer.com/m/framer/store.js@^1.0.0"
const useStore = createStore({
isOpen: false,
})
export function withToggle(Component): ComponentType {
return (props) => {
const [store, setStore] = useStore()
return (
<Component
{...props}
onClick={() => setStore({ isOpen: !store.isOpen })}
/>
)
}
}
export function withVisibility(Component): ComponentType {
return (props) => {
const [store] = useStore()
return (
<Component
{...props}
style={{
...props.style,
opacity: store.isOpen ? 1 : 0,
pointerEvents: store.isOpen ? "auto" : "none",
}}
/>
)
}
}
Output Standards
- Always include detailed comments explaining key logic (the user relies on AI-generated code and needs to understand what each section does).
- Keep code concise — no unnecessary abstractions.
- Default to
motion.divfor the root element in components (enables animation props). - Use inline styles only (no CSS modules, no styled-components).
- Test mentally: would this code paste into Framer's code editor and work without modification?
What ships with it: 1 file
4.9 KB alongside SKILL.md
references/
- property-controls.md4.9 KB