@erikt/ui

中文文档
0.0.46发布于 2026/11/13ES Module零依赖近 30 天下载 2089
原始使用文档
文档目录3 节
  1. Web components
  2. Local docs
  3. License

erikt/ui

Documentation

gzip size

CSS cascade layers, custom properties, color-mix(), light-dark(), anchor positioning, and the Popover API have collectively closed most of the gap that large UI libraries were built to fill. @erikt/ui takes that foundation and adds a focused component layer on top. A single stylesheet that styles native HTML elements without requiring a component model, a compiler, or a runtime.

<link rel="stylesheet" href="https://esm.sh/@erikt/ui" />
  • 🗂️ One file
  • 🏷️ No class names required
  • ⚔️ Your styles always win
  • 🌗 Dark mode built in
  • 🎨 Themeable
  • 📐 Zero layout opinions
  • 🤖 AI-ready

Web components

A couple of optional, dependency-free custom elements ship alongside the stylesheet: <relative-time> and <copy-to-clipboard>. They're opt-in, no other part of @erikt/ui depends on them.

<script type="module" src="https://esm.sh/@erikt/ui/elements"></script>

See the docs for usage.

Local docs

The docs ship with the npm package. After installing, serve them on http://localhost:3456:

npx @erikt/ui docs

License

MIT

版本与发布记录

@erikt/ui 共发布 34 个版本,首次发布于 2026/06/13;过去 12 个月发布了 34 个版本。

版本发布日期距今
0.0.46latest2026/11/131 天前
0.0.452026/11/112 天前
0.0.442026/10/2916 天前
0.0.432026/10/2717 天前
0.0.422026/10/2717 天前
0.0.402026/10/2619 天前

关于 @erikt/ui 的常见问题

如何安装 @erikt/ui?

在项目目录运行 npm install @erikt/ui,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 erikt-ui,可以用 npx erikt-ui 直接运行。

@erikt/ui 支持 TypeScript 吗?

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

@erikt/ui 支持 ESM 还是 CommonJS?

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

@erikt/ui 可以商用吗?

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

@erikt/ui 的下载量有多少?

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

@erikt/ui 还在维护吗?

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