API Reference
A list of exports from the framer
library available in every Code Component.
RenderTarget
To detect which context your Code Component is currently being shown, you can import and use RenderTarget
. This includes RenderTarget.current()
function to check the current RenderTarget as well as few types to check them against.
RenderTarget.canvas
— The CanvasRenderTarget.thumbnail
— Dashboard ThumbnailsRenderTarget.preview
— The Preview or live site
Localization
When using Localization with Framer you may want to create a custom Locale Picker. In most cases you should do this with Smart Components, which you can learn about in the Localization 2.0 video. However if you have very specific needs based on logic there is an API for getting and setting the current Locale info.
useLocaleInfo()
Property Controls
Property Controls allow users to pass props to a Code Component through the Framer interface. There is only one function needed for this feature, however the full type reference can be found in our Property Controls Guide.
addPropertyControls(component, controls)
Framer Motion
Also available in every Code Component is the entire Motion for React API. This can be imported from "framer-motion"
.