BUILDER

Resources

Home

Forum

Github

Login

Signup

This page was made in Builder!

Getting Started with Builder

Getting started with Builder is simple.

Builder.io can be customized to meet all kinds of needs, from simple headless data models to full on landing page building. You can choose to allow complete free-form control of Builder.io content or limit it to your design system components.

Landing pages quick start

In this quick start example, we will set up freeform landing page building for any site with just a few lines of code.

When a request to your site comes to a URL you don't otherwise have a route for, make a request to Builder's HTML API (or use a framework-specific SDK, such as React, Next.js, Gatsby, Angular, etc) passing in the requested URL and your API key.

If Builder matches a page for this URL, return the page contents. Otherwise, send (or redirect to) your 404 page.

React

HTML API

Plain JS

Angular

Also see our guides for Next.js and Gatsby

import { BuilderComponent, builder } from '@builder.io/react'

builder.init('YOUR_KEY')
 
export default let HomePage = () => {
  const [pageJson, setPage] = useState(null)

  useEffect(() => { 
    builder.get('page', { url: '/' }).promise().then(setPage)
  , [])

  return <BuilderComponent model="page" content={pageJson} />
}
Learn more about dynamic pages
import { Builder } from '@builder.io/react'
 
// Register our heading component for use in 
// the visual editor
const Heading = props => (
  <h1 className={style}>{props.title}</h1>
)
 
Builder.registerComponent(Heading, { 
  name: 'Heading',
  inputs: [{ name: 'title', type: 'text' }]
})
Learn more about using your components

Try it in CodeSandbox

And that's it!

You've just added the ability to create custom landing pages to your site. See this guide to extend this example for SEO optimizing your landing pages by requiring custom titles, descriptions, and other meta info.

You can do a ton more with Builder.io than just landing pages. See our guide on creating custom models to learn how to use Builder.io on any page using component models, data models, or a number of other advanced techniques.

Featured Tutorials

Creating a site-wide ribbon

Creating a blog with Builder and React

Creating a landing page in Builder

Additional framework support:

Code Sandbox Examples

Server Side

React

Plain JS

Gatsby

Next.js

Angular

View this code on Github

Up next

SEO Optimization
Was this article helpful?