framer-code-components

Implements Framer code components with property controls, layout annotations, and platform constraints.

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/leonardoacosta/agents --skill framer-code-components-leonardoacosta
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: framer-code-components
Source: https://github.com/leonardoacosta/agents/tree/main/skills/framer-code-components
Command: npx skills add https://github.com/leonardoacosta/agents --skill framer-code-components-leonardoacosta

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires react, react-dom, framer, framer-motion.

What problem does it solve? Writing code components for Framer requires following strict platform rules—single-file default exports, restricted imports, SSR guards, and layout annotations—that are easy to violate and cause canvas errors. This Skill provides the constraints, property control reference, and TypeScript interfaces needed to author components that render correctly in Framer. ## Core Features & Use Cases - Platform Constraint Enforcement: Covers single-file default exports, allowed imports (react, framer, framer-motion), SSR-safe window/document access, and required @framerSupportedLayoutWidth/Height annotations. - Property Controls Reference: Documents every ControlType (Boolean, Number, String, Enum, Color, ResponsiveImage, Array, Slot, Font, Transition, and more) with examples and full TypeScript interfaces. - Authoring Best Practices: Guidance on animation performance with useIsStaticRenderer, accessibility, image defaults, and common errors like WebGL cross-origin issues. - Use Case: When building a configurable hero section component for a Framer site, use this Skill to add Color, Font, and ResponsiveImage property controls with correct defaults so the component renders properly on the canvas and in static exports. ## Quick Start Load the framer skill first and read the Components row of the project task map, then use this Skill to write a Framer code component with typed props and property controls.

Frequently Asked Questions about framer-code-components

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add property controls to a Framer code component?

Use addPropertyControls from the framer package with a ControlType for each prop, such as ControlType.Color or ControlType.String. Provide a defaultValue for every control so the component renders correctly on the Framer canvas.

What imports are allowed in Framer code components?

Only react, react-dom, framer, and framer-motion are allowed. Import motion from framer-motion, not from framer, and use a single file with a named function default export rather than arrow functions or named exports.

Why does my Framer component break during static rendering?

Static renderers lack browser APIs, so unguarded window or document access throws errors. Guard with typeof window !== "undefined" and use useIsStaticRenderer from framer to return a static preview instead of animations.

How do Framer layout annotations work for auto-sizing components?

Add @framerSupportedLayoutWidth and @framerSupportedLayoutHeight in a block comment above the component. Use auto for text-based sizing, fixed for no intrinsic size, and any-prefer-fixed for flexible content.

Can I use defaultProps on Framer code components?

No, ComponentName.defaultProps is not supported in Framer. Set defaults through the defaultValue field on each property control, or destructure defaults in the component body for ResponsiveImage controls.