_The visual editor for React_
Documentation • Puck AI • Demo • Discord
⭐️ Enjoying Puck? Please leave a star!
What is Puck?
Puck is an open-source visual editor for React. Build drag-and-drop interfaces with your own components.
Embed Puck as a React component in your existing application. You own your components and data, with no vendor lock-in.
Puck's MIT license permits internal and commercial use.
Quick Start
1. Install the package
npm i @puckeditor/core --save
2. Render the editor
// Editor.jsx
import { Puck } from "@puckeditor/core";
// Create Puck component config
const config = {
components: {
HeadingBlock: {
fields: {
children: {
type: "text",
},
},
render: ({ children }) => {
return <h1>{children}</h1>;
},
},
},
};
// Describe the initial data
const initialData = {};
// Save pages to your backend (see step 4)
const save = (data) => {};
// Render Puck editor
export function Editor() {
return <Puck config={config} data={initialData} onPublish={save} />;
}
3. Render the page
// Page.jsx
import { Render } from "@puckeditor/core";
export function Page() {
return <Render config={config} data={data} />;
}
4. Choose a backend (optional)
Puck is designed to integrate into your existing backend. If you don't already have one or are building a new app, consider Puck Cloud.
Puck Cloud
Puck Cloud is our modular, hosted backend for Puck with a versioned page database, managed authentication, and much more. It's best for when you have no existing backend or database, and is free to start.
To configure it, run the Puck CLI, and select the modules you require:
npx @puckeditor/core init
Pages
Puck Pages is a hosted page store built for Puck, providing version history and data migrations.
npx @puckeditor/core add pages
Auth
Puck Auth provides managed authentication for Puck, allowing users to sign-in with a Puck Cloud account.
npx @puckeditor/core add auth
AI
Puck AI is an AI agent for Puck for generating interfaces directly from the editor.
npx @puckeditor/core add ai
Community
- Discord server for discussions
- awesome-puck community repo for plugins, custom fields & more
Get support
If you have any questions about Puck, please open a GitHub issue or join us on Discord.
License
MIT © The Puck Contributors