@timmo001/groundwork-ui

中文文档
0.9.33发布于 2026/11/03Apache-2.0ES Module零依赖构建来源已验证

Groundwork's framework-free web components, styled by the --gw-* tokens

原始使用文档
文档目录3 节
  1. Install
  2. Use
  3. Custom Elements Manifest

@timmo001/groundwork-ui

Groundwork's web components: framework-free custom elements styled by the --gw-* tokens from @timmo001/groundwork-tokens.

Install

bun add -E @timmo001/groundwork-ui @timmo001/groundwork-tokens

Use

Import the theme CSS once, then the components. Importing the package defines every gw- element.

import "@timmo001/groundwork-tokens/themes.css";
import "@timmo001/groundwork-ui";
<html data-gw-theme="base" data-gw-mode="dark">
  <gw-button appearance="filled">Save</gw-button>
</html>

The package ships TypeScript source, so it needs a bundler that compiles it, such as Vite, Astro or Bun.

Every component, its attributes, slots, parts and events are documented at groundwork.timmo.dev/components.

Custom Elements Manifest

The package ships custom-elements.json, a Custom Elements Manifest generated from each element's class docstring, and points to it from customElements in package.json. Editors, lit-analyzer and framework wrappers read it for the elements' attributes, properties, slots, parts and events. mise run gen writes it, and mise run check fails when it's stale.

版本与发布记录

@timmo001/groundwork-ui 共发布 44 个版本,首次发布于 2026/11/01;过去 12 个月发布了 44 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.9.33latest2026/11/03今天
0.9.322026/11/021 天前
0.9.312026/11/021 天前
0.9.302026/11/021 天前
0.9.292026/11/021 天前
0.9.282026/11/021 天前

关于 @timmo001/groundwork-ui 的常见问题

@timmo001/groundwork-ui 是什么?

基于——gw-*标记的无框架web组件

如何安装 @timmo001/groundwork-ui?

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

@timmo001/groundwork-ui 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/timmo001__groundwork-ui 是否存在。

@timmo001/groundwork-ui 支持 ESM 还是 CommonJS?

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

@timmo001/groundwork-ui 可以商用吗?

@timmo001/groundwork-ui 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@timmo001/groundwork-ui 还在维护吗?

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