Documentation Index
Fetch the complete documentation index at: https://mintlify.com/finsweet/attributes/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Inject attribute allows you to dynamically load and insert components from other Webflow projects into your current page. This enables component reusability across projects and external component libraries.Attribute Syntax
Elements
Defines the role of the element:
target- The container where the component will be injectedcomponent- The component to be loaded (can also useelementas an alias)
Settings
Defines the URL of the Webflow page containing the component. Can be internal (same project) or external (different project).
Defines where the component should be inserted within the target:
before- Insert before the target’s contentafter- Insert after the target’s contentreplace- Replace the target’s content (default)
Defines whether to import CSS from external components. When
true, external components are loaded in a Shadow DOM with their styles. Set to false to disable CSS import.Defines whether the component should be automatically rendered. Set to
false to load but not render, allowing manual rendering via JavaScript.Defines a CORS proxy prefix for loading external components that have CORS restrictions.
Defines whether to cache loaded components. Set to
false to always fetch fresh content.Defines a custom cache key for the component. Useful for cache management.
Defines a cache version number. Increment to bust the cache and reload the component.
Defines whether to restart Webflow interactions after rendering. Set to
true if the injected component contains Webflow interactions.Usage Examples
Common Use Cases
Shared Navigation
Maintain a single navigation component across multiple Webflow projects, updating it in one place.Component Libraries
Create a central library of reusable components (buttons, cards, forms) and inject them into multiple projects.Dynamic Content
Load frequently updated content (announcements, promotions) from a central location into multiple pages.A/B Testing
Swap different component variations by changing the source URL dynamically.Modular Page Building
Build pages by assembling pre-built components from a component library.Component Source Format
The source URL can point to:- Same project page:
/page-slug#component-id - External project:
https://example.webflow.io/page#component-id - Full URL: Any publicly accessible Webflow page
When injecting external components with
fs-inject-css="true", the component is loaded inside a Shadow DOM to isolate its styles. This prevents style conflicts but may affect how you can style the component from outside.Performance Considerations
- Enable caching for components that don’t change frequently
- Use cache versioning to control updates without disabling cache
- Consider loading components on interaction rather than page load for better initial performance
- Minimize the number of external sources to reduce HTTP requests