@great-expectations/jsonforms-antd-renderers

中文文档
2.3.5发布于 2026/04/18MITTypeScriptESM + CJS构建来源已验证近 30 天下载 3.3万

ant design renderer set for the jsonforms declarative form framework

原始使用文档
文档目录8 节
  1. Getting started
  2. Using AntD Renderers
  3. Writing UISchemas
  4. Contributing
  5. First time setup
  6. Making changes
  7. Conventional commits
  8. Testing the package locally

codecov pre-commit.ci status

Ant Design Renderers for jsonforms

jsonforms is "a declarative framework for efficiently building form-based web UIs." jsonforms has multiple renderer packages for different frameworks and component libraries, and this is one such package. You can preview the renderers via storybook here.

Getting started

npm install @great-expectations/jsonforms-antd-renderers

Using AntD Renderers

In order to use this package you need to import the renderer registry entries from this package and provide them to the @jsonforms/react JsonForms component:

import { JsonForms } from "@jsonforms/react"
import {
  rendererRegistryEntries,
  cellRegistryEntries,
} from "@great-expectations/jsonforms-antd-renderers"

function MyForm({ data }: { data: Record<string, unknown> }) {
  return (
    <JsonForms
      data={data}
      schema={schema}
      renderers={rendererRegistryEntries}
      cells={cellRegistryEntries}
    />
  )
}

Writing UISchemas

This package expands upon the types and configurability of jsonforms UISchemas. When writing UISchemas, you'll want to provide your jsonschema's type to our UISchema type to take advantage of advanced typechecking & UI configurability. See our storybooks (instructions for running storybooks under Contributing) for more examples.

import { useState } from "react"
import { Form, Button } from "antd"
import { JsonForms } from "@jsonforms/react"
import {
  rendererRegistryEntries,
  UISchema,
} from "@great-expectations/jsonforms-antd-renderers"

const schema = {
  type: "object",
  properties: { password: { type: "string" } },
} as const
// Be sure to use an `as const` assertion so that UISchema
// can see the specific types of `type` fields within a schema.
// i.e. without `as const`, the value "object" is interpreted
// as a string type, and not the string literal type "object"

const uischema: UISchema<typeof schema> = {
  type: "VerticalLayout",
  elements: [
    {
      type: "Control",
      scope: "#/properties/password",
      // Properties like type: "password" here are unique to this renderer package.
      // This allows you more declarative control over how your forms render.
      // In this case, the password field will be rendered with AntD's password input component.
      options: { type: "password" },
    },
  ],
}

function MyForm() {
  const [data, setData] = useState<Record<string, unknown>>({})

  return (
    <Form onFinish={() => myApiCall(data)}>
      <JsonForms
        data={data}
        onChange={(result) => setData(result.data as Record<string, unknown>)}
        schema={schema}
        uischema={uischema}
        renderers={rendererRegistryEntries}
      />
      <Form.Item>
        <Button htmlType="submit">Submit</Button>
      </Form.Item>
    </Form>
  )
}

Contributing

First time setup

  • Install node.js (only Node v20 is currently supported)
  • Install the version of pnpm specified in the packageManager field in package.json
  • Clone this repository
  • Install dependencies: pnpm i --frozen-lockfile
  • Run tests: pnpm test
  • Run tests and view coverage:
    • pnpm test:cov
    • npx vite preview --outDir html
    • in the terminal, type o + enter to open the results in a browser
  • Run storybook: pnpm storybook

Making changes

  • Make changes to the code
  • Run tests: pnpm test
  • Run storybook: pnpm storybook
  • Run format: pnpm format:write
  • Run lint: pnpm lint
  • Commit your changes

Conventional commits

  • We use semantic release to version & release our package, so make sure your commits adhere to the conventional commit format
  • In particular a commit message of the form fix(<scope>): <short summary>, feat(<scope>): <short summary>, or BREAKING CHANGE: <short summary> will trigger a release. short summary is required. scope is optional.

Testing the package locally

  • Create an installable tarball file from this directory: pnpm pack
  • If you previously installed the package, you may need to remove it first: npm uninstall @great-expectations/jsonforms-antd-renderers and possibly clear your package manager's cache
  • Install the package in your project: npm install /path/to/jsonforms-antd-renderers-0.0.0-semantic-release.tgz

版本与发布记录

@great-expectations/jsonforms-antd-renderers 共发布 65 个版本,首次发布于 2024/03/12;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.3.5latest2026/04/186 个月前
2.3.42026/04/176 个月前
2.3.32026/04/177 个月前
2.3.22026/03/267 个月前
2.3.12026/03/078 个月前
2.3.02026/03/068 个月前

关于 @great-expectations/jsonforms-antd-renderers 的常见问题

@great-expectations/jsonforms-antd-renderers 是什么?

ant design renderer set for the jsonforms declarative form framework

如何安装 @great-expectations/jsonforms-antd-renderers?

在项目目录运行 npm install @great-expectations/jsonforms-antd-renderers,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@ant-design/icons(^5.3.0)、@jsonforms/core(^3.3.0)、@jsonforms/react(^3.3.0)、antd(^5.14.0)、dayjs(^1)、react(^17 || ^18)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@great-expectations/jsonforms-antd-renderers 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@great-expectations/jsonforms-antd-renderers 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@great-expectations/jsonforms-antd-renderers 可以商用吗?

@great-expectations/jsonforms-antd-renderers 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@great-expectations/jsonforms-antd-renderers 的下载量有多少?

根据 npm 官方下载统计,@great-expectations/jsonforms-antd-renderers 在 2026/10/17 – 2026/11/15 这 30 天内被下载 32,506 次,日均约 1,084 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@great-expectations/jsonforms-antd-renderers 还在维护吗?

最新版本 2.3.5 发布于 2026/04/18(6 个月前);至今共发布 65 个版本,其中过去 12 个月发布了 10 个;首次发布于 2024/03/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。