Installation
This reference covers the configuration required to export Webflow components into a React project using DevLink.
Install the Webflow CLI
Install the CLI as a development dependency to your React project to bundle and publish your component library:
DevLink supports React v16.18.0 and higher
The minimum version of React supported to use exported components is v16.18.0.
Create a configuration file
DevLink looks for a webflow.json
file in the root of your project, which defines settings for DevLink setup and sync.
webflow.json
is a newer configuration file that supports configuration for Webflow Cloud and DevLink. DevLink also supports the older .webflowrc.js
file for backwards compatibility.
Configuration options
While DevLink will try to assume reasonable defaults for most of the settings, you can specify certain options to customize the behavior of DevLink management and setup.
skipTagSelectors
When true
, DevLink filters out global CSS rules with certain selectors, producing a smaller global.css
file. Specifically, it removes:
- Tag selectors (e.g.,
div
,p
,h1
) - ID selectors (e.g.,
#myId
) - Attribute selectors (e.g.,
[type="text"]
) - Pseudo-class selectors (e.g.,
:hover
,:focus
) - except for:root
This is useful when you only want class-based styles from Webflow and prefer to exclude global tag defaults. Empty rules are dropped entirely.
Define height/widths of parent elements
When using skipTagSelectors: true
, ensure parent elements of DevLink components have defined heights/widths, or set height: 100% on your HTML and body elements to allow proper rendering of components.
relativeHrefRoot
Controls how relative href
values are rewritten in exported Link and Image components.
Example:
-
With
"/"
:- Page link to “About” →
href="/about"
- Section link →
href="#contact-section"
- CMS page link →
href="/blog/my-blog-post"
- Page link to “About” →
-
With
"https://my-site.com"
:- Page link to “About” →
href="https://my-site.com/about"
- Section link →
href="https://my-site.com#contact-section"
- CMS page link →
href="https://my-site.com/blog/my-blog-post"
- Page link to “About” →
envVariables
Inject environment variables into components. Useful for APIs like Maps or Recaptcha.
fileExtensions
Customize the extensions used for exported component files.