Skip to content
Drag and drop page building using your code components
TypeScript JavaScript Objective-C HTML Starlark Java Other
Branch: master
Clone or download

Latest commit

Latest commit 56ac624 Mar 30, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Update README.md Mar 30, 2020
packages Update README.md Mar 30, 2020
plugins Publish Mar 30, 2020
starters update name=".." to model=".." in all examples Mar 30, 2020
.gitattributes Starting out Jan 31, 2019
.gitignore restruct query overrides Feb 5, 2020
.nvmrc fix react sdk build error and add nvmrc Feb 3, 2020
.prettierrc lerna Feb 11, 2019
.travis.yml Starting out Jan 31, 2019
LICENSE project setup Feb 1, 2019
README.md Update README.md Mar 30, 2020
lerna.json plugin mvp 0 Nov 12, 2019
package-lock.json update example to use plugin (#83) Mar 3, 2020
package.json ignore widgets too Mar 23, 2020
tslint.json Starting out Jan 31, 2019

README.md

BUILDER

Drag and drop page building with your code components. Bring your design systems to life!


Editor example

Register components Rendered your visually created 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' }]
})
import { BuilderComponent } from '@builder.io/react'
 
// Include this in your app, and Builder.io will render  
// the matching page by the current document's URL. Scroll 
// down for more advanced options and examples
export default let BuilderPage = () => (
  <BuilderComponent model="page" />
)

Who uses Builder.io?

 

How does it work?

  • Integrate the Builder API or SDK to your site or app
  • Create a free account on builder.io and drag and drop to create and publish pages
  • Profit

What is it good for?

  • Landing pages
  • Design systems
  • Marketing & content pages (Homepage, promotions, merchandising, about, FAQ, help, docs, etc)
  • Freedom from marketing teams that never stop asking for new things
  • Developers who are tired of pushing pixels

Supported Frameworks

Framework Status
REST API Stable
React Stable
Next.js Stable
Gatsby Stable
Webcomponents Stable
Angular Stable
React native Beta
Email Stable
AMP Stable
Preact Stable
Everyting else
Go, Php, Java, Vue, Ruby/Rails, Vanilla JS, etc
Use our HTML API

Want suppoert for something not listed here or for us to priotize something coming soon? Drop us an issue and let us know! We prioritize based on the community's needs and interests.

What's in this repository?

This repo houses all of the various SDKs, usage examples, starter projects, and plugins

Try it in Storybook

Try out a live demo of our Storybook example or use our Storybook addon with your own components, refer to our design systems example for lots of examples using your deisgn system + custom components + storybook.

example

Getting Started with React

npm install @builder.io/react

Grab a free account at builder.io and find your API key

Next, create a new page in Builder with URL /something and publish it.

Then, in your code:

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

builder.init(YOUR_KEY);

And in your router

<Route path="/something" render={() => <BuilderComponent model="page" />}>

Create a new page with url "/something" in Builder and change the preview URL to localhost:port/something (e.g. localhost:8888/something if your dev server is on port 8888) and edit!

See more info on setting up your preview urls here.

Also, see the full React API here

Using your components

See this design systems example for lots of examples using your deisgn system + custom components + storybook

👉Tip: want to limit page building to only your components? Try components only mode

Register a component

import { Builder } from '@builder.io/react';

class SimpleText extends React.Component {
  render() {
    return <h1>{this.props.text}</h1>;
  }
}

Builder.registerComponent(SimpleText, {
  name: 'Simple Text',
  inputs: [{ name: 'text', type: 'string' }],
})

Then back at your page

import './simple-text'

// ...

<Route path="/something" render={() => <BuilderComponent model="page">}>

Open the dashboard and use it!

See our docs site for additional help and information, or contact us if you run into any issues or questions!

For lots of examples of using React components in Builder, see the source for our built-in Builder blocks here and widgets here

Dynamic landing pages

👉Tip: see our guides for Next.js and Gatsby for best support for those frameworks

One of Builder's most powerful features is allowing the creation of new pages for you. See a simple example of how to do this with react-router below:

class CatchAllPage extends Component {
  state = {
    notFound: false,
  };

  render() {
    return !this.props.notFound ? (
      <BuilderComponent
        model="page"
        contentLoaded={content => {
          if (!content) {
            this.setState({ notFound: true });
          }
        }}
      >
        Loading...
      </BuilderComponent>
    ) : (
      <NotFound /> // Your 404 component
    );
  }
}

// Then in your app.js
export default () => (
  <Switch>
    <Route path="/" component={Home} />
    {/* Your other routes... */}
    <Route component={CatchAllPage} />
  </Switch>
);

For more advanced usage, like checking for page existence/404 on the server using the Content API, see our detail landing page docs here or if using Next.js see our docs for that here

Also see a more complext design system example here

Don't use React?

Our HTML API works for any site

let page = await request(
  `https://cdn.builder.io/api/v1/html/page?url=${PAGE_URL}&apiKey=${YOUR_KEY}`
);
if (page) {
  let html = page.data.html;
  // Put the html in your page template between your header and footer and you are done!
}

We're hiring!

Want to work on the future of visual software development? Email me at steve@builder.io and let's talk

John the community!

Questions? Requests? Feedback? Chat with us in our official forum!

Troubleshooting and feedback

Problems? Requests? Open an issue. We always want to hear feedback and interesting new use cases and are happy to help.

You can’t perform that action at this time.