@duetds/components

中文文档
10.8.3发布于 2026/11/10SEE LICENSE IN LICENSE.mdTypeScriptESM + CJS近 30 天下载 2万

This package includes Duet Design System Web Components and related utilities.

原始使用文档
文档目录6 节
  1. Usage
  2. Architecture
  3. Development
  4. How to develop new components
  5. Documentation and examples
  6. Copyright

Build Status Version

Duet Components

This package includes Duet Web Components and related tools.

Usage

For usage instructions, please see Duet Design System documentation.

Architecture

This package is built with Stencil.js, a compiler and toolchain for building web components. The component source code is written in TypeScript + JSX (TSX), with stylesheets written in SCSS.

Development

The following are the most commonly used commands during development:

  • npm start - Compile components, start watching for changes, start local development server
  • npm test - Compile components, start watching for changes, start local development server and run tests.

The local development server started by npm start or npm test serves a files located at /src/prototypes/. Any local changes or new components are available on this page, so this can be used as a testing ground when developing.

On that page you can also press ctrl + p to choose any of the component fixtures to work on.

How to develop new components

  1. Create component files
    1. add directory for component under src/components/[component-name]
    2. add [component-name].tsx
    3. add [component-name].scss
    4. add [component-name].e2e.ts
    5. add readme.md
  2. Implement component
  3. Write tests
  4. Write readme
    1. add info for docs
    2. add comprehensive examples
  5. Test theming for both default and turva
  6. Browser testing
  7. Accessibility testing, following the Duet accessibility checklist
  8. Test SSR
  9. Add the following to docs/:
    1. An SVG icon for listing on component page
    2. Add to changelog.md

Documentation and examples

  • Documentation that is shown on duetds.com acts as our primary component development platform. To get started locally, open /docs/ directory and run npm install and npm start.
  • Once the server is up and running, you can access the local development environment by pointing your browser to http://localhost:8000. The components section in the documentation will be empty at this point.
  • Next, go to /packages/components/ directory and run npm install and npm start that starts up the component watch and build tasks.
  • If you now open any of the *.tsx, *.scss, or readme.md files underneath /packages/components/src/components/ and hit save, that will trigger a rebuild task which also copies the necessary changes over to the local documentation running at http://localhost:8000.
  • Editing *.tsx and *.scss files will generate a new JavaScript bundle, while editing the readme.md files only generates and copies over the documentation and component usage examples.
  • When working on new components or editing existing ones, make sure to follow our code style guide found under the guidelines section.
  • Component variation examples are inside each component’s readme.md, while the component templates are located under /docs/src/templates/ directory.

Copyright © 2023 LocalTapiola/Turva.

版本与发布记录

@duetds/components 共发布 704 个版本,首次发布于 2019/03/14;过去 12 个月发布了 51 个版本。

版本发布日期距今
10.8.3latest2026/11/103 天前
10.8.22026/10/3014 天前
10.8.12026/09/281 个月前
10.8.02026/09/231 个月前
10.7.02026/09/102 个月前
10.6.02026/09/022 个月前

其他发布通道:next → 10.0.0-alpha.32。

关于 @duetds/components 的常见问题

@duetds/components 是什么?

This package includes Duet Design System Web Components and related utilities.

如何安装 @duetds/components?

在项目目录运行 npm install @duetds/components,或使用 pnpm add / yarn add / bun add。

@duetds/components 支持 TypeScript 吗?

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

@duetds/components 支持 ESM 还是 CommonJS?

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

@duetds/components 可以商用吗?

@duetds/components 使用 SEE LICENSE IN LICENSE.md 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

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

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

@duetds/components 还在维护吗?

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