@apideck/components

中文文档
0.13.3发布于 2025/10/06MITTypeScriptESM + CJS近 30 天下载 1.8万

An open-source UI component library for the efficient development of beautiful React applications.

原始使用文档
文档目录3 节
  1. Usage
  2. Components
  3. Utils

Apideck Component Library

An open-source UI component library for the efficient development of beautiful React applications.

Go to developers.apideck.com/components for the full documentation.

Usage

Install the component library

yarn add @apideck/components

The styles are scoped to the apideck class name so add it to the top-level parent or body tag.

import { ModalProvider, ToastProvider } from '@apideck/components'
import { AppProps } from 'next/app'

const App = ({ Component, pageProps }: AppProps) => {
  return (
    <div className="apideck">
      <ModalProvider>
        <ToastProvider>{children}</ToastProvider>
      </ModalProvider>
    </div>
  )
}

export default App

Use components inside your project:

import { Button } from '@apideck/components'

const App = () => {
  return <Button variant="primary" size="large" text="Yo, world!" />
}

export default App

If you are NOT using Tailwind CSS in your project, make sure to include the styles in your project:

import '@apideck/components/dist/styles.css'

The components library is styled using Tailwind CSS. If you were to use it in a project that also uses Tailwind CSS, you do not have to include the styles.css file but you should include the package path in the content path of the tailwind.config.js.

// tailwind.config.js

module.exports = {
  content: ['./node_modules/@apideck/components/**/*.js'],
  ...
}

If want to overwrite the primary color you can add your custom colors to the primary color option inside your Tailwind configuration:

// tailwind.config.js

module.exports = {
  content: ['./node_modules/@apideck/components/**/*.js'],
  theme: {
    extend: {
      colors: {
        primary: {
          50:  '#faf6f9',
          100: '#fae7f7',
          200: '#f5c4f3',
          300: '#f39dee',
          400: '#f469e7',
          500: '#f53fe1',
          600: '#e909ef',
          700: '#c81ead',
          800: '#9c1a81',
          900: '#7c1762',
        }
      }
    }
  }
  ...
}

Components

Utils

  • useModal and ModalProvider
  • useToast and ToastProvider
  • useOutsideClick
  • usePrevious
  • useDebounce

Please refer to the Apideck docs for the full documentation.

版本与发布记录

@apideck/components 共发布 140 个版本,首次发布于 2021/03/10;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.13.3latest2025/10/061.1 年前
0.13.22025/04/091.6 年前
0.13.12025/04/091.6 年前
0.12.212024/01/242 年前
0.12.202023/12/222 年前
0.12.192023/12/222 年前

其他发布通道:next → 0.8.4-1。

关于 @apideck/components 的常见问题

@apideck/components 是什么?

An open-source UI component library for the efficient development of beautiful React applications.

如何安装 @apideck/components?

在项目目录运行 npm install @apideck/components,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=16)、react-dom(>=16)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@apideck/components 支持 TypeScript 吗?

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

@apideck/components 支持 ESM 还是 CommonJS?

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

@apideck/components 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=10。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@apideck/components 可以商用吗?

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

@apideck/components 的下载量有多少?

根据 npm 官方下载统计,@apideck/components 在 2026/10/06 – 2026/11/04 这 30 天内被下载 18,365 次,日均约 612 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@apideck/components 还在维护吗?

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