展示 HN:Composify – 开源可视化编辑器 / React 的服务器驱动 UI
Show HN: Composify – Open-Source Visual Editor / Server-Driven UI for React

原始链接: https://github.com/composify-js/composify

## Composify:React 组件的可视化编辑 Composify 是一个开源的 React 库,提供了一个可视化编辑器,使非开发者能够使用现有的、可用于生产环境的组件来构建和修改页面。Composify 不同于僵化的页面构建器或复杂的无头 CMS,它弥合了差距,允许团队使用他们已建立的设计系统来可视化地组合内容。 只需在目录中注册你的 React 组件,用户就可以拖放它们、调整属性并创建动态页面,而无需工程支持。这可以实现更快的 UI 更改——甚至无需重新部署的即时更新——非常适合营销活动、A/B 测试和快速原型设计。 Composify 提供服务器端 UI 解决方案,赋予内容和营销团队自主权,同时工程师可以专注于核心功能开发。它与 Next.js、Remix 以及任何 React 环境兼容,并且你可以保留完全的数据所有权。 对于需要完全托管解决方案的团队,Composify Cloud 提供托管、协作功能和版本历史记录。详细文档和项目贡献请访问 [composify.js.org/docs](https://composify.js.org/docs)。

## Composify:React 组件可视化编辑器 Composify 是一款新的开源工具,旨在赋能非开发者构建和修改基于 React 的着陆页和营销内容,无需工程干预。这款工具的创建者是一位工程师,他厌倦了持续的页面更新请求。Composify 允许用户拖放*现有* React 组件到指定位置,直接生成 JSX 代码——无需新的模式或组件修改。 该工具曾在之前的创业公司成功驱动了 60% 的流量,简化了营销工作流程并实现了 A/B 测试。它弥合了限制性强的无代码构建工具和需要组件适配的无头 CMS 解决方案之间的差距。 虽然仍在早期开发阶段(文档需要改进),Composify 仍然提供了一个精简、可用于生产环境的解决方案,供希望利用其现有组件库进行灵活、非开发者驱动的内容创建的团队使用。 访问地址:[https://composify.js.org](https://composify.js.org)。
相关文章

原文

Composify is an open-source library that adds a visual editor to your React application. It lets non-developers build pages using your existing production components, so engineers can focus on actual feature work.

Most visual builders force you into a binary choice: use a rigid page builder with generic components (Wix, Squarespace) or adopt a complex headless CMS that requires modifying your code to fit their platform (Builder.io, Puck, Storyblok).

Composify sits in the middle. It is a visual interface for your actual component code. Register your components once, and anyone on your team can use them to build pages visually. Your design system stays intact. Marketing and content teams compose pages without filing tickets.

It's just a React library. Works with Next.js, Remix, or any React environment. You own your data.

Check out the live demo to see it in action.

# npm
$ npm install @composify/react --save

# pnpm
$ pnpm add @composify/react

# yarn
$ yarn add @composify/react

Before you can use a component in the Editor or Renderer, you need to register it in the Catalog.

// catalog.tsx
import { Catalog } from '@composify/react/renderer';

const Text = ({ textAlign, children }) => (
  <p style={{ textAlign }}>{children}</p>
);

Catalog.register('Text', {
  component: Text,
  props: {
    textAlign: {
      label: 'Text Align',
      type: 'radio',
      options: [
        { label: 'Left', value: 'left' },
        { label: 'Center', value: 'center' },
        { label: 'Right', value: 'right' },
      ],
      default: 'left',
    },
    children: {
      label: 'Text',
      type: 'string',
      default: 'Hello, world!',
    },
  },
});

Important: Import this catalog file at your app's entry point (like index.tsx or _app.tsx) so the registration happens before the app renders.

Once registered, you can render JSX from a string using the Renderer component:

// page.tsx
import { Renderer } from '@composify/react/renderer';

const source = `
  <div>
    <h1>Welcome to Composify!</h1>
    <Text textAlign="center">This is a simple example.</Text>
  </div>
`;

export const Page = () => (
  <Renderer source={source} />
);

To let users edit the content, use the Editor component:

// editor.tsx
import { Editor } from '@composify/react/editor';
import '@composify/react/style.css';

const source = `
  <div>
    <h1>Welcome to Composify!</h1>
    <Text textAlign="center">This is a simple example.</Text>
  </div>
`;

export const Page = () => (
  <Editor title="My Page" source={source} onSubmit={console.log} />
);

Users can drag and drop components, modify props via the sidebar, and nest elements. Upon save, the editor serializes the tree back into a clean JSX string.

We built Composify to solve a common problem. Engineers build component libraries, but only engineers can use them effectively.

Ship UI changes without deployments

Most apps ship with a hard-coded UI. Even small tweaks require a full redeploy. With Composify, your UI lives on the server. Change it there, and it's live everywhere, instantly. No CI/CD, no app store reviews, no waiting.

Big tech does this already. Airbnb has Ghost Platform. Yelp built CHAOS. Lyft and Shopify have their own SDUI systems. Composify gives you that same power without the in-house infrastructure.

In most companies, small UI tweaks end up in the engineering backlog. Marketing wants to launch a promo. Content editors want to tweak a landing page. The ops team is running a seasonal campaign.

With Composify, the roles become clear:

  • Engineers focus on what they do best: building robust, reusable components
  • Non-developers use the visual editor to bring those components to life

A/B testing and rapid prototyping

Want to test a different page layout for a user segment? Or prototype a feature directly in production? Swap out page structures, personalize onboarding flows, test new CTAs. It all happens server-side. No redeploys. No branching strategies.

Traditional CMSs lock you into themes and templates. You end up rebuilding your design system inside a clunky page builder, and the result never quite matches your actual app.

With Composify, content teams use the same components that power your core product. What they edit is exactly what ships.

More details on use cases in the documentation.

The open-source library gives you the engine (Editor and Renderer). Building the car (database, API, version history, collaboration) takes time.

Composify Cloud is the infrastructure layer for teams that want the benefits without maintaining the backend:

  • Managed hosting - No infrastructure to manage, unlimited bandwidth
  • Real-time collaboration - Multiple team members can edit the same page simultaneously
  • Version history - Time-travel through changes and restore previous versions

Full documentation is available at composify.js.org/docs.

We welcome contributions. Whether you're fixing bugs, adding features, or improving docs, pull requests and issues are always welcome.

This project is licensed under the Elastic License 2.0. Free to use for most cases, with some restrictions on offering Composify as a hosted service. See the license file for details.

联系我们 contact @ memedata.com