npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yl2/designer

v0.0.1

Published

低代码可视化设计器组件,支持拖拽式表单/CRUD 页面设计,提供组件物料面板、属性配置面板、画布预览、代码编辑等完整设计能力。

Readme

@yl2/designer

低代码可视化设计器组件,支持拖拽式表单/CRUD 页面设计,提供组件物料面板、属性配置面板、画布预览、代码编辑等完整设计能力。

✨ 特性

  • 🎨 拖拽式界面设计,所见即所得
  • 📦 内置基础组件、高级组件、布局组件物料库
  • 🔧 支持自定义业务组件扩展
  • 📝 JSON Schema 驱动,数据模型可视化
  • 🖥️ 支持 Form 和 Crud 两种页面模板
  • 🌓 亮色/暗色主题切换
  • 💻 内嵌 Monaco 代码编辑器,支持状态管理代码编写
  • 📄 多页面设计(Modal / Drawer 子页面)

📦 安装

# pnpm
pnpm install @yl2/designer

# npm
npm install @yl2/designer

前置依赖

{
  "peerDependencies": {
    "react": "^18.x",
    "react-dom": "^18.x",
    "shineout": "^3.x",
    "@yl2/reactive": "*",
    "@yl2/editor": "*",
    "@yl2/transcoder": "*",
    "@yl2/components": "*"
  }
}

🚀 使用

import { TemplateDesign } from "@yl2/designer";

const App = () => {
  const jsonSchema = {
    type: "Form", // 或 "Crud"
    // ... 表单/表格配置
  };

  return (
    <TemplateDesign
      theme="light"
      moduleName="user-manage"
      jsonSchema={jsonSchema}
      onSave={(schemaStr, name) => {
        console.log("保存:", schemaStr, name);
      }}
    />
  );
};

📖 API

TemplateDesign Props

| 属性 | 类型 | 默认值 | 说明 | | ------------------ | -------------------------------------- | --------- | ---------------------------------------------------- | | theme | 'light' \| 'dark' \| null | 'light' | 主题模式 | | moduleName | string | - | 模型名称,用于标识当前设计的模块 | | jsonSchema | object | - | 数据模型,type 字段决定模板类型(Form / Crud) | | businessMaterial | BusinessMaterialProps[] | [] | 自定义业务组件列表 | | headerExtraContent | (v?: string) => ReactNode | - | 头部操作区域自定义渲染 | | onSave | (str: string, name?: string) => void | - | 保存回调,返回序列化后的 Schema 字符串 | | logo | ReactNode | - | 设计器 Logo | | readOnly | boolean | false | 是否只读模式 | | designerRequire | Record<string, any> | {} | 注入到设计器运行时的外部模块依赖 |

BusinessMaterialProps

| 属性 | 类型 | 说明 | | --------- | -------- | ----------------------------------------- | | tag | string | 组件标签文案 | | tagColor | string | 标签颜色 | | component | any | 组件实例 | | assets | any | 组件物料描述(包含 type、label、name 等) |

🏗️ 架构

src/
├── template/       # 模板入口(Form / Crud)
├── sider/          # 左侧物料面板(基础/高级/布局/业务组件)
├── canvas/         # 中间画布区域(设计器视图 + 数据模型查看)
├── panel/          # 右侧属性配置面板
├── header/         # 顶部操作栏
├── bar/            # 工具条
├── folders/        # 多页面管理(Page / Modal / Drawer)
├── monaco/         # 内嵌代码编辑器
├── schema/         # 物料 Schema 定义(表单/表格/Tabs)
├── icon/           # 组件图标
├── store.ts        # 全局状态管理(基于 @yl2/reactive)
└── util.ts         # 工具函数

📄 License

MIT