Craft.js logo

Craft.js

Create custom drag‑and‑drop page editors using React.

Craft.js is a React framework that lets you build fully customizable drag‑and‑drop page editors, handling component rendering, editing, state serialization, and extensible APIs.

Craft.js banner

Overview

Overview

Craft.js provides a modular, React‑first foundation for building page editors that fit your exact UI and interaction requirements. It supplies a drag‑and‑drop engine, component lifecycle handling, and a query‑based API so you can render, move, and edit any React component inside an editor canvas.

Who it's for & deployment

Designed for React developers who need a bespoke editor—such as SaaS platforms, e‑commerce builders, or internal tools—Craft.js integrates like any other React library. You compose the editor UI with familiar JSX, serialize the editor state to JSON for storage, and restore it on the server or client as needed. Because the framework is pure React, it works with TypeScript, modern bundlers, and can be deployed to any environment that runs a React application.

Highlights

Modular drag‑and‑drop system built on React.
Full control over component editing and UI layout.
Extensible API for state manipulation and custom actions.
Serializable editor state to JSON for persistence.

Pros

  • Complete UI flexibility; no locked editor UI.
  • Leverages familiar React patterns and ecosystem.
  • Easy integration of custom components and droppable regions.
  • State can be saved and restored via JSON.

Considerations

  • Requires developer to implement editor UI from scratch.
  • Learning curve for the Craft.js API and node queries.
  • No built‑in ready‑made toolbar or panels.
  • Performance depends on React rendering; large trees may need optimization.

Managed products teams compare with

When teams consider Craft.js, these hosted platforms usually appear on the same shortlist.

Carrd logo

Carrd

One‑page site builder for simple personal pages, portfolios, and landing pages

Framer logo

Framer

Design and no‑code site builder from Figma‑like canvas

Instapage logo

Instapage

Landing page builder for conversion optimization and personalized experiences

Looking for a hosted option? These are the services engineering teams benchmark against before choosing open source.

Fit guide

Great for

  • Teams building SaaS platforms that need a bespoke page builder.
  • Developers who prefer React‑first solutions over plugin‑heavy libraries.
  • Projects that require custom editing workflows or component behavior.
  • Applications that need to store editor state in a database or CMS.

Not ideal when

  • Users seeking an out‑of‑the‑box visual editor with pre‑designed UI.
  • Non‑React projects or those using alternative frameworks.
  • Simple static sites where a full editor is overkill.
  • Teams without capacity to design and maintain custom editor interfaces.

How teams use it

Custom Landing Page Builder

Enable marketers to assemble landing pages with brand‑specific components while preserving full design control.

In‑app Content Editing for SaaS Dashboard

Allow end‑users to modify widgets and layout directly within the application, persisting changes via JSON.

E‑commerce Product Page Composer

Provide merchants a drag‑and‑drop interface to arrange product details, galleries, and promotional sections.

Internal Documentation Portal Builder

Let teams create and reorganize documentation pages using reusable React components, with versioned state stored in a CMS.

Tech snapshot

TypeScript90%
JavaScript5%
CSS4%
Shell1%

Tags

page-builderwysiwygdrag-and-dropdraft-jsreactweb-buildersite-builderhtml-builder

Frequently asked questions

Which version of React is required?

Craft.js works with React 16.8+ (hooks support) and is compatible with the latest stable releases.

How can I persist the editor state?

Use the `query.serialize()` method to obtain a JSON representation, then store it in a database, local storage, or any backend of your choice.

Does Craft.js include a pre‑built UI library?

No. It provides the engine and API; you build the UI (toolbars, panels, etc.) using regular React components.

Can I use Craft.js with TypeScript?

Yes. The library is written in TypeScript and ships with type definitions.

How does Craft.js differ from Grape.js or other builders?

Craft.js is a React framework focused on giving developers full control over the editor UI, whereas Grape.js offers a ready‑made HTML builder with its own UI.

Project at a glance

Stable
Stars
8,499
Watchers
8,499
Forks
831
LicenseMIT
Repo age6 years old
Last commit11 months ago
Primary languageTypeScript

Last synced 12 hours ago