# prevwong/craft.js

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/prevwong-craft-js).**

8,683 stars · 842 forks · TypeScript · MIT

## Links

- GitHub: https://github.com/prevwong/craft.js
- Homepage: https://craft.js.org
- awesome-repositories: https://awesome-repositories.com/repository/prevwong-craft-js.md

## Topics

`draft-js` `drag-and-drop` `html-builder` `page-builder` `react` `site-builder` `web-builder` `wysiwyg`

## Description

Craft.js is a framework for building extensible drag-and-drop page editors using React components and serializable state management. It provides the core infrastructure to construct custom page builders where users can compose layouts by dragging, dropping, and repositioning elements within a structured editor environment.

The framework manages editor state through a component-based node tree, where each user element is represented as an internal node storing its type, props, and parent relationships. This state is managed via React Context and can be serialized to JSON for persistence and sharing of page designs. The editor supports custom rendering overrides, allowing developers to replace default element rendering with their own React components, and provides a drag-and-drop event system with configurable drop indicator styling.

Developers can define user components as reusable building blocks, mark elements as droppable regions that accept child components, and create component toolboxes that serve as palettes of draggable items. The framework supports inline property editing through content-editable interfaces or dedicated settings panels, layer tree management with customizable rendering and expansion controls, and the ability to inspect and manipulate editor state programmatically. Custom editing interfaces can be defined for components, enabling interactive editing experiences like modals for updating props.

## Tags

### User Interface & Experience

- [Drag-and-Drop Page Builders](https://awesome-repositories.com/f/user-interface-experience/drag-and-drop-page-builders.md) — A framework for building custom drag-and-drop page editors with extensible React components and serializable state.
- [Drag-and-Drop Page Editors](https://awesome-repositories.com/f/user-interface-experience/drag-and-drop-page-editors.md) — A framework for building extensible drag-and-drop page editors with React components and serializable state management.
- [Droppable Zone Definitions](https://awesome-repositories.com/f/user-interface-experience/interactive-ui-elements/interactive-element-registries/droppable-zone-definitions.md) — Marks elements as containers that accept child elements, making those children draggable within the editor. ([source](https://craft.js.org/docs/concepts/nodes))
- [Draggable Layout Elements](https://awesome-repositories.com/f/user-interface-experience/interactive-widgets/draggable-layout-elements.md) — Enables elements to be placed as children of droppable regions and repositioned via drag-and-drop. ([source](https://craft.js.org/docs/concepts/nodes))
- [Draggable Component Definitions](https://awesome-repositories.com/f/user-interface-experience/layout-positioning/user-defined-layouts/draggable-component-definitions.md) — Creates reusable building blocks that end users can drag, drop, and edit within the page editor. ([source](https://craft.js.org/docs/guides/basic-tutorial))
- [Editor Node Trees](https://awesome-repositories.com/f/user-interface-experience/node-based-ui-components/editor-node-trees.md) — Provides the internal node tree that represents every user element in the page editor.
- [Internal Node Representations](https://awesome-repositories.com/f/user-interface-experience/programmatic-element-editing/internal-node-representations.md) — Represents each user element as an internal node storing type, props, and parent relationships for state management. ([source](https://craft.js.org/docs/concepts/nodes))
- [Rendering Overrides](https://awesome-repositories.com/f/user-interface-experience/rendering-overrides.md) — Allows replacing default rendering of user elements with custom React components for flexible UI control.
- [Property Editing Panels](https://awesome-repositories.com/f/user-interface-experience/element-property-inspection/property-editing-panels.md) — Supports modifying component props directly through content-editable interfaces or dedicated settings panels.
- [Layer Tree Expanders](https://awesome-repositories.com/f/user-interface-experience/expanding-content-cells/layer-tree-expanders.md) — Ships a layer tree with configurable default expansion of root nodes for managing nested components. ([source](https://craft.js.org/docs/additional/layers))
- [Component Editing Interfaces](https://awesome-repositories.com/f/user-interface-experience/modal-components/modal-editing-interfaces/component-editing-interfaces.md) — Defines custom editing interfaces for components enabling interactive editing like content-editable text. ([source](https://craft.js.org/docs/overview))

### Part of an Awesome List

- [Drag and Drop](https://awesome-repositories.com/f/awesome-lists/devtools/drag-and-drop.md) — Provides the core drag-and-drop event system for repositioning components within a page editor. ([source](https://craft.js.org/docs/guides/basic-tutorial))

### Data & Databases

- [Editor](https://awesome-repositories.com/f/data-databases/agent-state-persistence/state-serialization/editor.md) — Exports and imports the full editor layout as JSON for persistence or sharing of page designs.
- [JSON Export and Restore](https://awesome-repositories.com/f/data-databases/json-document-stores/json-search-indices/index-serialization/json-export-and-restore.md) — Exports and imports the full editor layout as JSON for persistence and sharing of page designs. ([source](https://craft.js.org/docs/overview))

### Development Tools & Productivity

- [Component Toolboxes](https://awesome-repositories.com/f/development-tools-productivity/developer-toolboxes/component-toolboxes.md) — Provides a palette of draggable items that create new component instances when dropped into the editor. ([source](https://craft.js.org/docs/guides/basic-tutorial))
- [Programmatic State Inspectors](https://awesome-repositories.com/f/development-tools-productivity/change-tracking/state-tracking-utilities/action-based-state-tracking/editor-state-management/programmatic-state-inspectors.md) — Provides APIs to inspect and manipulate the editor's internal node tree for features like copying components. ([source](https://craft.js.org/docs/overview))
- [Draggable Component Palettes](https://awesome-repositories.com/f/development-tools-productivity/developer-toolboxes/draggable-component-palettes.md) — Provides a component toolbox that serves as a palette of draggable items for building page layouts.
- [Editor State APIs](https://awesome-repositories.com/f/development-tools-productivity/editor-state-apis.md) — Provides APIs to read the current editor state including all nodes, events, and selected elements. ([source](https://craft.js.org/docs/api/editor-state))

### Software Engineering & Architecture

- [Reactive Design JSON States](https://awesome-repositories.com/f/software-engineering-architecture/json-state-synchronization/reactive-design-json-states.md) — Exports and imports the full editor layout as JSON for persistence and sharing of page designs.

### Web Development

- [React State Bindings](https://awesome-repositories.com/f/web-development/react-state-bindings.md) — Manages editor state through React Context, enabling components to read and manipulate the page composition tree.

### Game Development

- [Custom Editing Interfaces](https://awesome-repositories.com/f/game-development/component-property-editing/custom-editing-interfaces.md) — Allows defining custom editing interfaces for components, enabling interactive editing like modals for updating props.

### Graphics & Multimedia

- [Component Layer Trees](https://awesome-repositories.com/f/graphics-multimedia/graphics-and-media/vector-graphics-editors/layer-management/component-layer-trees.md) — Manages and customizes the display of nested component layers in the editor interface with expansion controls.
