@deriv-com/ui

中文文档
1.37.2发布于 2025/07/22TypeScriptES Module近 30 天下载 1.3万

NPM Version NPM Downloads <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="@deriv-com/ui is released under the MIT

原始使用文档
文档目录5 节
  1. Overview
  2. Getting Started
  3. Usage Example
  4. Development
  5. Contributing

Deriv Ui Library (@deriv-com/ui)

NPM Version NPM Downloads @deriv-com/ui is released under the MIT license. Coverage Status

Overview

This is a UI component library made for ReactJS that conforms to the Deriv Design System. Explore our Storybook for for comprehensive development documentation .

Also available on npm.

It features two main sections:

  • components: contains all the components that are built to be used in the deriv platform.
  • hooks: which contains all the hooks that might be needed in deriv projects. for now we only have two hooks (useOnClickOutside and useDevice)

Getting Started

To get started simply install it from the @deriv-com/ui package:

npm i @deriv-com/ui

Usage Example

import {Button} from "@deriv-com/ui"

<Button  color="primary" rounded="sm"  size="md"  type="button"  variant="contained"  >  Click me! </Button>

you can explore the Storybook to learn about the available props for each component.

Development

To get started, first install all of the relevant packages by doing:

npm i

Since this projects uses Storybook to showcase the components. You can serve them by simply running this command:

npm run storybook

Contributing

Contributions to the @deriv-com/ui library are warmly encouraged. If you have suggestions for enhancements or encounter a bug, please feel free to open an issue or submit a pull request (ensure you fork it first).

版本与发布记录

@deriv-com/ui 共发布 182 个版本,首次发布于 2024/01/12;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.37.2latest2025/07/221.3 年前
1.37.12024/11/262 年前
1.37.02024/11/212 年前
1.36.42024/10/152 年前
1.36.32024/10/152 年前
1.36.22024/10/112 年前

关于 @deriv-com/ui 的常见问题

@deriv-com/ui 是什么?

<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="@deriv-com/ui is released under the MIT

如何安装 @deriv-com/ui?

在项目目录运行 npm install @deriv-com/ui,或使用 pnpm add / yarn add / bun add。

@deriv-com/ui 支持 TypeScript 吗?

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

@deriv-com/ui 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@deriv-com/ui 可以商用吗?

@deriv-com/ui 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@deriv-com/ui 的下载量有多少?

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

@deriv-com/ui 还在维护吗?

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