Convert Figma logo to code with AI

BuilderIO logobuilder

Visual Development for React, Vue, Svelte, Qwik, and more

7,257
897
7,257
150

Top Related Projects

124,777

The React Framework

55,199

The best React-based framework with performance, scalability and security built in.

54,014

The Intuitive Vue Framework.

78,194

Cybernetically enhanced web apps

207,677

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core

227,213

The library for web and native user interfaces.

Quick Overview

BuilderIO/builder is an open-source headless CMS and page builder that enables developers to create drag-and-drop interfaces for content editing. It offers a visual editing experience for non-technical users while allowing developers to maintain control over the codebase and integrate with various frameworks and platforms.

Pros

  • Framework-agnostic: Works with React, Vue, Angular, and other popular frameworks
  • Customizable: Developers can create custom components and integrate them into the visual editor
  • Headless architecture: Provides flexibility in content delivery and integration with various frontends
  • Visual editing: Offers an intuitive drag-and-drop interface for non-technical users

Cons

  • Learning curve: Requires initial setup and configuration for optimal use
  • Limited out-of-the-box design options: May require additional customization for complex layouts
  • Potential performance impact: Dynamically rendered content may affect page load times if not optimized

Code Examples

  1. Initializing Builder in a React component:
import { Builder, BuilderComponent } from '@builder.io/react';

Builder.init('YOUR_API_KEY');

function MyPage() {
  return <BuilderComponent model="page" />;
}
  1. Creating a custom component:
import { Builder } from '@builder.io/react';

function CustomHero({ title, subtitle }) {
  return (
    <div>
      <h1>{title}</h1>
      <p>{subtitle}</p>
    </div>
  );
}

Builder.registerComponent(CustomHero, {
  name: 'Custom Hero',
  inputs: [
    { name: 'title', type: 'string' },
    { name: 'subtitle', type: 'string' }
  ],
});
  1. Fetching content using Builder's API:
import { builder } from '@builder.io/react';

async function fetchContent() {
  const content = await builder.get('page', {
    url: window.location.pathname
  }).promise();

  return content;
}

Getting Started

  1. Install Builder.io in your project:

    npm install @builder.io/react
    
  2. Initialize Builder with your API key:

    import { Builder } from '@builder.io/react';
    Builder.init('YOUR_API_KEY');
    
  3. Add the BuilderComponent to your page:

    import { BuilderComponent } from '@builder.io/react';
    
    function Page() {
      return <BuilderComponent model="page" />;
    }
    
  4. Create content in the Builder.io dashboard and publish it to see it rendered in your application.

Competitor Comparisons

124,777

The React Framework

Pros of Next.js

  • More mature and widely adopted framework with a larger ecosystem
  • Offers server-side rendering and static site generation out of the box
  • Extensive documentation and community support

Cons of Next.js

  • Steeper learning curve for developers new to React or server-side rendering
  • Less flexible for non-React projects or custom build configurations
  • Requires more setup and configuration for advanced features

Code Comparison

Next.js:

import { useEffect, useState } from 'react'

export default function Home() {
  const [data, setData] = useState(null)
  useEffect(() => {
    fetch('/api/data').then(res => res.json()).then(setData)
  }, [])
  return <div>{data ? JSON.stringify(data) : 'Loading...'}</div>
}

Builder:

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

Builder.registerComponent(
  ({ title, description }) => (
    <div>
      <h1>{title}</h1>
      <p>{description}</p>
    </div>
  ),
  { name: 'CustomComponent', inputs: [{ name: 'title', type: 'text' }, { name: 'description', type: 'longText' }] }
)

The code examples showcase Next.js's built-in data fetching capabilities and Builder's component registration system, highlighting their different approaches to building web applications.

55,199

The best React-based framework with performance, scalability and security built in.

Pros of Gatsby

  • Extensive plugin ecosystem for integrating various data sources and functionalities
  • Strong performance optimization features, including image processing and code splitting
  • Large and active community, providing extensive resources and support

Cons of Gatsby

  • Steeper learning curve, especially for developers new to React or GraphQL
  • Longer build times for large sites, which can slow down development workflow
  • More complex setup and configuration compared to simpler static site generators

Code Comparison

Gatsby (React-based component):

import React from "react"
import { graphql } from "gatsby"

export default function BlogPost({ data }) {
  const post = data.markdownRemark
  return <div dangerouslySetInnerHTML={{ __html: post.html }} />
}

export const query = graphql`
  query($slug: String!) {
    markdownRemark(fields: { slug: { eq: $slug } }) {
      html
    }
  }
`

Builder (Visual component):

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

Builder.registerComponent(
  dynamic(() => import('./components/ProductGrid')),
  {
    name: 'Product Grid',
    inputs: [{ name: 'products', type: 'list' }],
  }
)

Both Gatsby and Builder offer powerful tools for building websites, but they cater to different needs. Gatsby excels in creating static sites with excellent performance, while Builder focuses on visual editing and content management. The choice between them depends on project requirements and team preferences.

54,014

The Intuitive Vue Framework.

Pros of Nuxt

  • Full-featured Vue.js framework with server-side rendering capabilities
  • Extensive ecosystem and community support
  • Built-in routing and state management solutions

Cons of Nuxt

  • Steeper learning curve for developers new to Vue.js or SSR
  • More opinionated structure, which may limit flexibility in some cases

Code Comparison

Nuxt (pages/index.vue):

<template>
  <div>
    <h1>{{ title }}</h1>
    <p>{{ description }}</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      title: 'Welcome to Nuxt',
      description: 'A Vue.js framework'
    }
  }
}
</script>

Builder (components/Welcome.jsx):

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

function Welcome() {
  return (
    <div>
      <h1>Welcome to Builder.io</h1>
      <p>A powerful visual editing platform</p>
    </div>
  )
}

Builder.registerComponent(Welcome, {
  name: 'Welcome'
})

While Nuxt provides a comprehensive Vue.js framework with built-in SSR capabilities, Builder focuses on visual editing and component-based development. Nuxt offers more out-of-the-box features for full-stack applications, whereas Builder emphasizes flexibility and ease of use for content management and visual editing workflows.

78,194

Cybernetically enhanced web apps

Pros of Svelte

  • Smaller bundle sizes and better performance due to compile-time optimization
  • Simpler, more intuitive syntax with less boilerplate code
  • Built-in state management and reactivity without additional libraries

Cons of Svelte

  • Smaller ecosystem and community compared to React-based solutions
  • Limited server-side rendering capabilities out of the box
  • Steeper learning curve for developers coming from traditional frameworks

Code Comparison

Svelte component:

<script>
  let count = 0;
  function increment() {
    count += 1;
  }
</script>

<button on:click={increment}>
  Clicks: {count}
</button>

Builder component:

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

const Counter = (props) => {
  const [count, setCount] = useState(0);
  return (
    <button onClick={() => setCount(count + 1)}>
      Clicks: {count}
    </button>
  );
};

Builder.registerComponent(Counter, {
  name: 'Counter',
  inputs: [],
});

While both frameworks allow for creating interactive components, Svelte's syntax is more concise and requires less setup. Builder, on the other hand, integrates seamlessly with visual editing tools and provides a more flexible approach to component registration and customization.

207,677

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core

Pros of Vue

  • More mature and widely adopted framework with a larger ecosystem
  • Comprehensive documentation and extensive community support
  • Flexible and easy to integrate with existing projects

Cons of Vue

  • Steeper learning curve for complex applications
  • Less suitable for visual drag-and-drop website building
  • May require more setup and configuration for advanced features

Code Comparison

Vue component example:

<template>
  <div>{{ message }}</div>
</template>

<script>
export default {
  data() {
    return {
      message: 'Hello, Vue!'
    }
  }
}
</script>

Builder component example:

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

Builder.registerComponent(
  ({ text }) => <div>{text}</div>,
  {
    name: 'Hello World',
    inputs: [{ name: 'text', type: 'text' }],
  }
);

While Vue focuses on creating reactive components with a template-script structure, Builder emphasizes visual editing and component registration for drag-and-drop interfaces. Vue is better suited for traditional web development, whereas Builder excels in no-code/low-code scenarios and visual website building.

227,213

The library for web and native user interfaces.

Pros of React

  • Mature ecosystem with extensive libraries and community support
  • Efficient rendering through virtual DOM and reconciliation
  • Widely adopted, making it easier to find developers and resources

Cons of React

  • Steeper learning curve, especially for complex state management
  • Requires additional tools and libraries for a complete application
  • Can be overkill for simple projects or static websites

Code Comparison

React:

function Welcome(props) {
  return <h1>Hello, {props.name}</h1>;
}

const element = <Welcome name="Sara" />;
ReactDOM.render(element, document.getElementById('root'));

Builder:

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

Builder.registerComponent(
  ({ name }) => <h1>Hello, {name}</h1>,
  { name: 'Welcome', inputs: [{ name: 'name', type: 'text' }] }
);

Summary

React is a powerful library for building user interfaces, offering a robust ecosystem and efficient rendering. However, it can be complex for beginners and may require additional tools. Builder, on the other hand, focuses on visual development and content management, making it easier for non-developers to create and manage content. While React provides more flexibility and control, Builder offers a more streamlined approach for certain use cases, especially in content-driven applications.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README



Builder.io logo


Visual Development On Any Stack

Turn Figma designs to code. Drag and drop with your components. Publish with a click.

code style: prettier PRs Welcome License Types


Animation of Builder.io Visual Editor

How the Builder.io platform works

Builder connects to your existing site or app and allows you to visually generate code (using your existing components) from either Figma designs or our drag and drop editor, and then export that code or publish those updates via our SDKs.

Read about how Builder works

How it works

Try it out!

Sign up for a free account to dive right in.

What's in this repository?

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

Join the community!

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

We're hiring!

Help us enable anyone to build digital experiences and bring more ideas to life --> https://www.builder.io/m/careers

NPM DownloadsLast 30 Days