@eagami/ui

中文文档
5.82.1发布于 2026/11/13MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 3667

Lightweight, accessible, themeable Angular UI component library and icon set built on CSS custom properties

原始使用文档
文档目录8 节
  1. Why Eagami UI
  2. Install
  3. Use
  4. Theme
  5. Forms
  6. Deploys
  7. Testing
  8. Links

Eagami UI

Eagami UI logo

npm version license Storybook WCAG 2.2 AA, tested with axe-core

@eagami/ui is a lightweight, accessible Angular component library and design system. Sensible defaults out of the box, with a fully customizable design to fit any brand.

Documentation · Components · Icons
Design tokens · Theme builder · Internationalization · Accessibility

Why Eagami UI

Themes to your brand. Give it one color per role and it generates a full, contrast-checked palette.

Lightweight. No runtime dependencies, no CSS framework, and standalone side-effect-free components, so your app bundles only what it imports.

Accessible and localized. Every component meets WCAG 2.2 AA with full keyboard support and its own axe-core test suite. Built-in text ships in 15 languages you can switch at runtime.

Yours to own. Plain Angular and CSS with no lock-in: read, copy, or fork any component like the rest of your app.

Modern Angular. Signals and native control flow throughout, with SSR-safe rendering, prerendering, and hydration.

Install

ng add @eagami/ui

The schematic installs the package and registers the global stylesheet, the fonts, and provideStaleBuildReload(). To wire it up by hand, see Setup.

Use

import { ButtonComponent } from '@eagami/ui';

@Component({
  imports: [ButtonComponent],
  template: `<ea-button (clicked)="save()">Save</ea-button>`,
})
export class MyComponent {
  save() {}
}

Theme

Pass one color per role to provideEagamiUi:

bootstrapApplication(AppComponent, {
  providers: [
    provideEagamiUi({
      palette: {
        primary: { base: '#2563eb' },
        secondary: { base: '#f97316' },
      },
    }),
  ],
});

Focus rings follow the primary color. When the brand hue reads as an error or a warning, give focus a color of its own with focus: { base: '#2563eb' } in the same palette.

Everything else is a CSS custom property you can override. See Design tokens.

Forms

showErrorsOn sets when form components show a validation error:

  • 'change' (the default): once the user changes the field and leaves it, or submits the form. A field the user tabs past stays quiet, and a new error waits until focus leaves the field.
  • 'blur': as soon as the user leaves the field, even unchanged, while a new error still waits until focus leaves the field.
  • 'touch': as soon as the user leaves the field, even unchanged, and live while they edit it after that.

Set it app-wide with forms, or on a single field with the showErrorsOn input every form component takes:

provideEagamiUi({ forms: { showErrorsOn: 'touch' } });

Deploys

A tab left open across a deploy still runs the old build, so the next page it lazy loads asks for a file the deploy removed. provideStaleBuildReload() from @eagami/ui/router loads that page in full on the new build instead, and tries only once:

bootstrapApplication(AppComponent, {
  providers: [provideRouter(routes), provideStaleBuildReload()],
});

Pass version and onReport to log how each reload turned out, and check isStaleBuildReloadError(error) to keep the error it answered out of your error reporting.

Testing

<ea-dialog> and <ea-drawer> are built on the native <dialog> element, and @eagami/ui/testing keeps them working in jsdom, which lacks showModal() and close(). Call installNativeDialogShim() once from your test setup file:

import { installNativeDialogShim } from '@eagami/ui/testing';

installNativeDialogShim();

Changelog · v4.x migration guide · Support · License

版本与发布记录

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

版本发布日期距今
5.82.1latest2026/11/13今天
5.82.02026/11/058 天前
5.81.12026/11/0211 天前
5.81.02026/11/0112 天前
5.80.02026/10/3113 天前
5.79.02026/10/2915 天前

关于 @eagami/ui 的常见问题

@eagami/ui 是什么?

Lightweight, accessible, themeable Angular UI component library and icon set built on CSS custom properties

如何安装 @eagami/ui?

在项目目录运行 npm install @eagami/ui,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@angular/core(^21.0.0 || ^22.0.0)、@angular/forms(^21.0.0 || ^22.0.0)、@angular/common(^21.0.0 || ^22.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@eagami/ui 支持 TypeScript 吗?

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

@eagami/ui 支持 ESM 还是 CommonJS?

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

@eagami/ui 需要什么版本的 Node.js?

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

@eagami/ui 可以商用吗?

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

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

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

@eagami/ui 还在维护吗?

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