Getting Started with DevLink
Export your Webflow components to a Next.js project in minutes with DevLink
In this guide, you’ll learn how to configure DevLink for your Webflow site and export components to a React project. While this guide uses Next.js, DevLink works with any React-based framework.
Devlink is in beta
Devlink is in beta. Visit webflow.com/cloud to get access with Webflow Cloud.
Time estimate: 15 minutes
Prerequisites:
- A Webflow account and Webflow site with components to export
- Node.js v20.0.0 or higher
- A package manager of your choice (npm, yarn, or pnpm)
- Basic familiarity with React
Setting up a Webflow project
If you don’t have a Webflow project yet, use a DevLink template from the Webflow marketplace. DevLink templates are pre-configured with components and styles optimized for React.
Getting started
1. Create your React project
2. Prepare your Webflow components
In your Webflow project, prepare any components you want to export to your React project by:
- Selecting an element or group of elements
- Right-clicking and selecting “Create Component”
- Naming your component (use clear, descriptive names)
Only elements that have been converted to Components can be exported via DevLink.
3. Configure DevLink in your app
Create a Webflow Site API token
DevLink requires access to your site to export your design system. To grant access, you’ll need to get your Site ID and create an API token with the sites:read
permission. Then configure DevLink with the required information to connect your Webflow site to your React project.
-
Get your Webflow Site ID
In your Webflow dashboard, select your site, and navigate to the Settings panel to get your Site ID. -
- In your Webflow Dashboard, go to Site Settings > Integrations > API Access
- Create a new token with the
sites:read
permission - Copy your new token
4. Sync and use your components
Sync your components
Run the DevLink sync command to export your Webflow components to your React project:
This will create a devlink
directory in your project containing:
- React components for each of your Webflow components
- CSS modules for component-specific styling
- A global CSS file for shared styles
- A DevLinkProvider component for handling interactions
Add the global DevLink styles
@/devlink
alias. See the troubleshooting guide for more information on how to set this up in your project.In your app/layout.tsx
file, import the global CSS file generated by DevLink to ensure all Webflow components have access to necessary styles and Webflow style resets. Additionally, if your Webflow components have interactions set on elements, wrap your application in the DevLinkProvider
component to enable those interactions at runtime:
Use your components
Now you can import and use your Webflow components in your application. In this particular example, it uses three components exported from Webflow via DevLink: Hero
, Card
, and Button
. You can use them in your application like so:
Updating your components
When you make changes to your components in Webflow, simply run the sync command again to update them in your React project:
This will update all your components while preserving any custom code or props you’ve added in your React application.
Common issues and solutions
Authentication Error
If you encounter authentication issues:
- Verify your API token has the correct permissions
- Ensure your environment variables are properly loaded
- Check that the
webflow.json
file is in the root directory
Missing Styles
If your components don’t look the same as in Webflow:
- Ensure you’ve imported
global.css
in your application - Import any additional fonts used on your site to your layout file
- Verify that the DevLinkProvider is properly set up
- Check for CSS conflicts with other styles in your project
Component Not Found
If a component isn’t available after syncing:
- Make sure it’s properly created as a Component in Webflow
- Check if it uses only supported elements