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

@pontx/shadcn-ui

v1.2.3

Published

基于 Shadcn UI + Radix UI 构建的 API 文档与调试组件库,提供开箱即用的 API 文档展示、接口目录、Schema 查看、在线调试等功能。

Downloads

138

Readme

@pontx/shadcn-ui

基于 Shadcn UI + Radix UI 构建的 API 文档与调试组件库,提供开箱即用的 API 文档展示、接口目录、Schema 查看、在线调试等功能。

安装

npm install @pontx/shadcn-ui
# or
pnpm add @pontx/shadcn-ui

Peer Dependencies

npm install react react-dom

核心组件

ApiDocumentation - API 文档

展示单个 API 的完整文档,包含参数说明、请求/响应 Schema、在线调试面板。

import { ApiDocumentation } from "@pontx/shadcn-ui/api-documentation";
import "@pontx/shadcn-ui/styles";

<ApiDocumentation
  api={apiData}
  enablePlayground
  specName="my-api"
  servers={[{ url: "https://api.example.com" }]}
  onExecute={(request) => fetch(request.url, { method: request.method })}
/>;

ApiDirectory - API 目录

以分组形式展示 API 列表,支持搜索和筛选。

import { ApiDirectory } from "@pontx/shadcn-ui/api-directory";

<ApiDirectory
  spec={pontxSpec}
  selectedApiName="getUser"
  onApiSelect={(name, api, tag) => console.log(name)}
  showMethod
  searchPlaceholder="搜索 API..."
/>;

SchemaViewer - Schema 查看器

可视化展示 JSON Schema 结构。

import { SchemaViewer } from "@pontx/shadcn-ui/schema-viewer";

<SchemaViewer schema={jsonSchema} />;

PlaygroundPanel - 在线调试面板

API 请求调试面板,支持参数填写、鉴权配置、请求发送、响应展示和代码生成。

import { PlaygroundPanel } from "@pontx/shadcn-ui/playground";

<PlaygroundPanel
  api={apiData}
  servers={servers}
  onExecute={handleExecute}
  executionResult={result}
  isExecuting={loading}
/>;

DebugPanel - 调试面板

import { DebugPanel } from "@pontx/shadcn-ui/debug-panel";

PontxApp - 完整应用

一站式 API 文档 SPA,集成目录、文档、调试等全部功能。

import { PontxApp } from "@pontx/shadcn-ui";

<PontxApp
  spec={pontxSpec}
  getCodeGenScenarios={() => [
    { id: "curl", label: "cURL", language: "shell" },
    { id: "typescript", label: "TypeScript", language: "typescript" },
  ]}
  onGenerateCode={({ scenarioId, request }) => generateCode(scenarioId, request)}
/>;

也可以直接使用预构建的 HTML 页面:

@pontx/shadcn-ui/app → dist/app/app.html

样式引入

使用组件前需要引入样式文件:

import "@pontx/shadcn-ui/styles";

导出路径

| 路径 | 说明 | | --------------------------------- | --------------- | | @pontx/shadcn-ui | 全量导出 | | @pontx/shadcn-ui/api-documentation | API 文档组件 | | @pontx/shadcn-ui/api-directory | API 目录组件 | | @pontx/shadcn-ui/schema-viewer | Schema 查看器 | | @pontx/shadcn-ui/debug-panel | 调试面板 | | @pontx/shadcn-ui/playground | Playground 组件 | | @pontx/shadcn-ui/styles | 样式文件 | | @pontx/shadcn-ui/app | 预构建 HTML 应用 |

鉴权支持

内置多种鉴权方式:

  • API Key - 支持 header / query / cookie
  • Bearer Token
  • Basic Auth
  • OAuth2

技术栈

  • React 18 / 19
  • TypeScript
  • TailwindCSS
  • Radix UI
  • Monaco Editor
  • @pontx/spec

License

MIT