Giter Club home page Giter Club logo

builder's Introduction

BUILDER

CircleCI code style: prettier PRs Welcome

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


Editor example

Register components Rendered your visually created content
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, builder } from '@builder.io/react'
  
builder.init('YOUR_KEY')
  
export default let BuilderPage = () => {
  const [pageJson, setPage] = useState(null)
 
  useEffect(() => { 
    builder.get('page', { url: '/' })
      .promise().then(setPage)
  , [])
 
  return <BuilderComponent model="page" content={pageJson} />
}

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 and content
  • Profit

What is it good for?

  • Landing pages on custom code stacks
  • Design systems and visually editing your custom components
  • 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

Try it out!

Supported Frameworks

Framework Status
REST API Stable
React Stable
Next.js Stable
Gatsby Stable
Shopify / Liquid Beta
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

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

// You can use the url="..." prop to automaticaly fetch the content for that URL,
// or omit this prop and Builder.io will fetch the corresponding page for the current
// location.pathname, if available
<Route path="/something" render={() => <BuilderComponent model="page" url="/something" />}>

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';

const SimpleText = props => <h1>{props.text}</h1>;

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

Then back at your page

import './simple-text'

// ...

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

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:

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

builder.init('YOUR_KEY')

export default let CatchAllPage = () => {
  const [pageJson, setPage] = useState()

  useEffect(() => {
    builder.get('page', { url: location.pathname })
       // The value will be `null` if no page was found
      .promise().then(setPage)
  , [])

  return pageJson === undefined
    ? <Loading />
    : pageJson
    ? <BuilderComponent model="page" content={pageJson} />
    : <NotFound />
}


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

Data models, components, SEO, and more

Builder.io gives you a ton more power and control than just page building. Check our guides on

Additional framework support:

As well as some handy power features like:

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!
}

Tip: You can make reusable components for your Builder.io pages using symbols

How it works

How it works

We're hiring!

Want to work on the future of visual software development? Email me at [email protected] 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.

builder's People

Contributors

steve8708 avatar ca136 avatar teleaziz avatar mrkoreye avatar dependabot[bot] avatar lyczos avatar mandx avatar muescha avatar asieraduriz avatar drazik avatar kevva avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.