Universal component compiler. Write components once and compile to Vue, React, Svelte, Angular, and more
Figma ↔ HTML
Convert Figma designs to React, Vue, HTML, CSS, Builder.io, and more. Even can import HTML and websites into editable figma layers
Made in Builder
If you have a Next.js application, you can build, edit, and add pages by dragging and dropping elements within Builder.io. This means that a developer can create the basic structure of an app by generating a Next.js application and then other team members, such as content creators, marketers, and sales specialists can autonomously iterate and update pages on the fly.
To build pages visually with Next.js, this tutorial guides you through:
Before following these steps to generate a Next.js app, make sure you have Node.js 12.0 or later on your computer.
At the command line, run the following command to generate a Next.js app with TypeScript:
When you're prompted for your permission to install
create-next-app, say yes.
For this example, name your project
Change directory with the
Open this directory in your favorite code editor.
To use drag-and-drop, add Builder as a dependency.
At the command line, use
npm to install Builder:
Start the development server with
Keep your editor open because we'll come back after some set up in Builder.
For more detailed information on Next.js, check out the official Next.js Getting Started.
pages directory, rename the default
[[...page]].tsx . The double square brackets,
[], are how Next.js creates dynamic routes, which means you can create pages with different names in Builder and Next.js can see them all.
Replace the code in
[[...page]].tsx with the following, making sure to add your Public API Key to the
This section explains what the code in
[[...page]].tsx is doing at a high level. For more detailed information, see the Next.js documentation.
At the top of the file, the import statements make all the Next.js and Builder resources available that the code in this file needs.
After the imports, you specify the Builder Public API Key and, with builder.init(), initialize connect your app to Builder.
getStaticProps() function tells you what paths the app is building. Here, Builder gets the page and creates the URL, otherwise, if there's no page, you'll get
null and a 404.
revalidate: 5 means that Next.js attempts to re-generate the page under these conditions:
getStaticPaths() function returns a list of pages, omits unnecessary data for creating the list, and with
fallback: true, checks Builder for any new pages you might have added.
The last section is a regular React component called
Page(). It gets the page data and checks that Builder is present. If there's no
page and no Builder, Next.js returns a 404. Otherwise, you get your Builder page.
Builder adds the ability for your team members–even those who don't code–to create pages and iterate on ideas with a drag-and-drop interface.
Head over to Builder.io to sign up for an account if you don't already have one. Come back when you're logged in.
If you're new to Builder, you'll see the following screen when you first login.
If you don't have the introductory prompt for creating a space, here's how you get it:
Click on the Organization icon on the bottom left.
Hover over Builder.io and choose + New Space.
Click Add Builder to an existing site or app.
When Builder asks you which ecommerce platform you use, select None.
Name your new space by entering "My Next.js App" and click Create.
To connect your Builder.io space to your application, set the site URL and get the API key as follows. Go to your Account settings by clicking on the Account icon in the left sidenav.
In the Account settings, change your Site URL to
http://localhost:3000 and copy the Public API Key. We're going to paste the API Key into your Next.js app in the next section.
Tip: When you change your Site URL to
http://locahost:3000, be sure to include the
Currently, when you go to
http://localhost:3000, you should see a 404 page. This is because your app is ready for you to provide a page to render.
To give your app something to work with, click on the Content icon in the left sidenav:
Click the +New button near the top right of the screen.
Create a new page in Builder and name it
When you are prompted to choose a starting template, choose Blank. The editor for your new page loads automatically.
In your new page, click the +Add Block button.
Select the text icon to add a text block.
Click Edit and add something like, "I did it!!".
Click the green Publish button in the upper right of the browser.
http://localhost:3000 and check out your work. Well done!
To make more pages, follow the same steps outlined here but name your pages with descriptive names such as "About Us" or "Current Projects" as in the following example.
Notice that Builder creates a URL from the page name. So "Current Projects" becomes
If you're getting a 404 but aren't sure why, check these things:
Follow the next step in this series by learning How to drag+drop to build pages visually with your React components to this app.
With Next.js and Builder working together, the next step is the fun part–add some pages in Builder and drag in some elements. Play with styles and explore the UI.
Learn how to use your React components in our visual editor.