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

sanli-component

v0.0.2

Published

低代码设计器组件库 - Schema 驱动的 React 组件

Readme

sanli-component

低代码设计器组件库 - Schema 驱动的 React 组件

安装

npm install sanli-component
# 或
yarn add sanli-component
# 或
pnpm add sanli-component

依赖

需要同时安装以下 peer dependencies:

npm install react react-dom antd @ant-design/pro-components

使用

基础使用

import { SchemaRenderer, componentRegistry } from 'sanli-component';

// 定义页面 Schema
const schema = {
  type: 'page',
  body: [
    {
      type: 'button',
      children: '点击我',
      type: 'primary'
    }
  ]
};

// 渲染
function App() {
  return <SchemaRenderer schema={schema} />;
}

获取组件元数据

import { componentRegistry } from 'sanli-component';

// 获取所有组件元数据
const allMetas = componentRegistry.getAllMetas();

// 按分类获取
const formComponents = componentRegistry.getMetasByCategory('form');
const dataComponents = componentRegistry.getMetasByCategory('data');

直接使用组件

import { Button, Form, Table } from 'sanli-component';

function MyPage() {
  return (
    <div>
      <Button type="primary">按钮</Button>
      <Table 
        columns={[{ title: '姓名', dataIndex: 'name' }]}
        dataSource={[{ id: 1, name: '张三' }]}
      />
    </div>
  );
}

组件列表

基础组件 (Basic)

  • Button 按钮
  • Text 文本
  • Icon 图标
  • Image 图片
  • Link 链接
  • Divider 分割线
  • Tpl 模板
  • Html HTML渲染

布局组件 (Layout)

  • Page 页面容器
  • Container 容器
  • Flex 弹性布局
  • Grid 栅格布局
  • Card 卡片
  • Tabs 标签页
  • Collapse 折叠面板
  • Wrapper 包裹器

表单组件 (Form)

  • Form 高级表单 (ProForm)
  • FormItem 表单项
  • InputText 文本输入
  • Textarea 多行输入
  • InputNumber 数字输入
  • Select 下拉选择
  • Checkbox 复选框
  • Radio 单选框
  • Switch 开关
  • DatePicker 日期选择
  • Upload 文件上传
  • TreeSelect 树选择
  • Cascader 级联选择

数据展示 (Data)

  • Table 高级表格 (ProTable)
  • List 高级列表 (ProList)
  • Descriptions 高级描述列表 (ProDescriptions)
  • Statistic 统计数值
  • Tag 标签
  • Badge 徽标
  • Progress 进度条
  • Timeline 时间轴
  • Steps 步骤条
  • Avatar 头像

反馈组件 (Feedback)

  • Alert 警告提示
  • Spinner 加载中
  • Empty 空状态
  • Result 结果页
  • Tooltip 文字提示
  • Popover 气泡卡片

版本更新

升级到最新版本获取新组件:

npm update sanli-component

License

MIT