easeui-core-components
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEaseUI Core Components & Design Tokens
EaseUI核心组件与设计令牌
Source of truth. Every token, component, and animation in this file is extracted from EaseUI's production codebase (+app/src/app/globals.css). Do NOT invent values — use these exactly.project/css/design-system.css
权威来源:本文件中的每一项令牌、组件和动效均提取自EaseUI的生产代码库(+app/src/app/globals.css)。请勿自行创建值——请严格使用此处提供的内容。project/css/design-system.css
🎨 Color Tokens
🎨 颜色令牌
Accent Palette
强调色板
| Token | Hex | Usage |
|---|---|---|
| | Success, AI completion, streaming indicators, positive feedback |
| | In-progress status, warnings |
| | Errors, destructive actions, |
| | Links, progress bars, info badges, focus rings |
| | Paused status, warnings |
| | Phase badges, AI gradient accents |
| 令牌 | 十六进制值 | 用途 |
|---|---|---|
| | 成功状态、AI生成完成、流式加载指示器、正向反馈 |
| | 进行中状态、警告 |
| | 错误、破坏性操作、 |
| | 链接、进度条、信息徽章、焦点环 |
| | 暂停状态、警告 |
| | 阶段徽章、AI渐变强调色 |
Neutrals
中性色
| Token | Value | Usage |
|---|---|---|
| | Page background |
| | Card surfaces |
| | Frosted nav bars |
| | Headings, primary content |
| | Descriptions, metadata |
| | Placeholders, disabled text |
| | Card borders |
| | Dividers, separators |
| 令牌 | 值 | 用途 |
|---|---|---|
| | 页面背景 |
| | 卡片表面 |
| | 毛玻璃导航栏 |
| | 标题、主要内容文本 |
| | 描述文本、元数据 |
| | 占位符、禁用状态文本 |
| | 卡片边框 |
| | 分隔线、分割符 |
Selection
选中文本样式
css
::selection { background: rgba(73, 186, 97, 0.2); color: inherit; }css
::selection { background: rgba(73, 186, 97, 0.2); color: inherit; }🔲 Shadow System
🔲 阴影系统
| Token | Usage | Light Layers |
|---|---|---|
| Floating toolbars, navbars | 2 layers, subtle |
| Default card rest state | 5 layers, nearly invisible |
| Light hover elevation | 1 layer |
| Card | 2 layers |
| Prompt bar input focus | 3 layers with inset white |
| Dropdowns, popovers, sidebar mobile | 4 layers |
| Modal overlays | 1 deep layer |
| Primary button depth | 3 layers with inset highlight |
| Dark button depth | 4 layers with inset rim |
| Destructive button | 3 layers, orange-tinted |
| Active tab indicator | 2 layers with inset white |
| 令牌 | 用途 | 层级(浅色模式) |
|---|---|---|
| 浮动工具栏、导航栏 | 2层,效果柔和 |
| 卡片默认静止状态 | 5层,几乎不可见 |
| 轻量悬浮抬升效果 | 1层 |
| 卡片 | 2层 |
| 提示栏输入框焦点状态 | 3层,内含白色内阴影 |
| 下拉菜单、弹出框、移动端侧边栏 | 4层 |
| 模态框遮罩 | 1层深色阴影 |
| 主按钮立体效果 | 3层,内含高亮内阴影 |
| 深色按钮立体效果 | 4层,内含边缘内阴影 |
| 破坏性按钮 | 3层,带橙色色调 |
| 激活标签指示器 | 2层,内含白色内阴影 |
📐 Radii
📐 圆角半径
| Token | Value | Usage |
|---|---|---|
| | Small badges, inputs |
| | Ghost buttons, tags |
| | Buttons (.btn default: |
| | Cards |
| | Badges, pills, scrollbars |
| 令牌 | 值 | 用途 |
|---|---|---|
| | 小型徽章、输入框 |
| | 幽灵按钮、标签 |
| | 按钮( |
| | 卡片 |
| | 徽章、胶囊型控件、滚动条 |
✏️ Typography
✏️ 排版系统
Font Stack
字体栈
css
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
--font-code: 'JetBrains Mono', ui-monospace, monospace;css
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
--font-code: 'JetBrains Mono', ui-monospace, monospace;Scale
字体层级
🔴 MINIMUM FONT SIZE: 12px (0.75rem). Never use smaller. No exceptions.
| Class | Size | Line Height | Tracking | Usage |
|---|---|---|---|---|
| 0.75rem (12px) | 1.4 | — | Badge labels, timestamps, metadata |
| 0.8125rem (13px) | 1.5 | — | Button text, descriptions |
| 0.875rem (14px) | 1.5 | — | Body text (EaseUI default) |
| 1rem (16px) | 1.5 | — | Emphasized body |
| 1.25rem (20px) | 1.3 | — | Subheadings |
| 1.5rem (24px) | 1.2 | — | Section headings |
| 1.875rem (30px) | 1.15 | -0.02em | Page titles |
🔴 最小字体尺寸:12px (0.75rem)。禁止使用更小尺寸,无例外。
| 类名 | 尺寸 | 行高 | 字间距 | 用途 |
|---|---|---|---|---|
| 0.75rem (12px) | 1.4 | — | 徽章标签、时间戳、元数据 |
| 0.8125rem (13px) | 1.5 | — | 按钮文本、描述文本 |
| 0.875rem (14px) | 1.5 | — | 正文文本(EaseUI默认值) |
| 1rem (16px) | 1.5 | — | 强调型正文 |
| 1.25rem (20px) | 1.3 | — | 子标题 |
| 1.5rem (24px) | 1.2 | — | 章节标题 |
| 1.875rem (30px) | 1.15 | -0.02em | 页面标题 |
Weights
字体权重
- = 500 — Labels, interactive text
.font-medium - = 600 — Buttons, subheadings
.font-semibold - = 700 — Page titles, hero text
.font-bold
- = 500 — 标签、交互文本
.font-medium - = 600 — 按钮、子标题
.font-semibold - = 700 — 页面标题、核心展示文本
.font-bold
🔘 Button System
🔘 按钮系统
Base .btn
.btn基础.btn
.btnHeight: 2.75rem (44px) | Padding: 0 1.25rem | Radius: 0.875rem (14px)
Font: 0.8125rem/600/-0.01em | Transition: transform 0.25s spring + shadow/opacity 0.2s高度: 2.75rem (44px) | 内边距: 0 1.25rem | 圆角: 0.875rem (14px)
字体: 0.8125rem/600/-0.01em | 过渡效果: transform 0.25s spring + shadow/opacity 0.2sVariants
变体
| Class | Background | Text | Shadow | Usage |
|---|---|---|---|---|
| | | | Primary actions (light button) |
| | | | Secondary actions (dark button) |
| | | | Destructive actions |
| | | none | Tertiary, toolbar actions |
| 类名 | 背景 | 文本 | 阴影 | 用途 |
|---|---|---|---|---|
| | | | 主要操作(浅色按钮) |
| | | | 次要操作(深色按钮) |
| | | | 破坏性操作 |
| | | none | tertiary操作、工具栏操作 |
States
状态
| State | Behavior |
|---|---|
| |
| |
| |
| |
| |
| 状态 | 行为 |
|---|---|
| |
| |
| |
| |
| |
🏷️ Badge System
🏷️ 徽章系统
Base .badge
.badge基础.badge
.badgeDisplay: inline-flex | Gap: 0.25rem | Padding: 0.125rem 0.5rem
Radius: --radius-full | Font: 0.6875rem/600/0.02em/uppercase显示方式: inline-flex | 间距: 0.25rem | 内边距: 0.125rem 0.5rem
圆角: --radius-full | 字体: 0.6875rem/600/0.02em/uppercaseStatus Variants
状态变体
| Class | Background | Text | Maps to |
|---|---|---|---|
| | | Feature shipped |
| | | Spec complete |
| | | In progress |
| | | Backlog |
| | | Paused |
| | | Priority 1 |
| | | Priority 2 |
| | | Priority 3 |
| | | Phase label |
| 类名 | 背景 | 文本 | 对应状态 |
|---|---|---|---|
| | | 功能已上线 |
| | | 需求文档完成 |
| | | 进行中 |
| | | 待办队列 |
| | | 已暂停 |
| | | 优先级1 |
| | | 优先级2 |
| | | 优先级3 |
| | | 阶段标签 |
🃏 Card System
🃏 卡片系统
Base .card
.card基础.card
.cardcss
background: var(--bg-card);
border: 1px solid var(--border-subtle);
border-radius: var(--radius-xl); /* 1.25rem = 20px */
padding: 1rem 1.125rem;
transition: box-shadow 0.2s ease, transform 0.2s ease;
cursor: pointer;css
background: var(--bg-card);
border: 1px solid var(--border-subtle);
border-radius: var(--radius-xl); /* 1.25rem = 20px */
padding: 1rem 1.125rem;
transition: box-shadow 0.2s ease, transform 0.2s ease;
cursor: pointer;Hover State
悬浮状态
css
.card:hover {
box-shadow: var(--shadow-card-hover);
transform: translateY(-1px);
}css
.card:hover {
box-shadow: var(--shadow-card-hover);
transform: translateY(-1px);
}⌨️ Keyboard Shortcut Badge .kbd
.kbd⌨️ 键盘快捷键徽章.kbd
.kbdSize: 1.25rem min-width/height | Padding: 0 0.3rem
Font: inherit/0.625rem/500 | Color: zinc-400
Background: zinc-100 | Border: 1px solid zinc-200 | Radius: 0.25rem尺寸: 最小宽高1.25rem | 内边距: 0 0.3rem
字体: inherit/0.625rem/500 | 颜色: zinc-400
背景: zinc-100 | 边框: 1px solid zinc-200 | 圆角: 0.25rem🎬 Animation Library
🎬 动效库
Page Transitions
页面过渡
| Class | Keyframes | Duration/Easing |
|---|---|---|
| | 0.4s |
| | 0.4s same easing |
| Staggered delays: 0ms, 50ms, 100ms, 150ms, 200ms, 250ms, 300ms, 350ms | Use for sequential entrance |
| opacity 0.5→1, scale 0.97→1 | 0.35s same easing |
| 类名 | 关键帧 | 时长/缓动函数 |
|---|---|---|
| | 0.4s |
| | 0.4s 相同缓动函数 |
| 延迟时间依次递增:0ms, 50ms, 100ms, 150ms, 200ms, 250ms, 300ms, 350ms | 用于元素依次入场 |
| 透明度0.5→1,缩放0.97→1 | 0.35s 相同缓动函数 |
AI / Streaming Animations
AI / 流式加载动效
| Class | Keyframes | Duration | Usage |
|---|---|---|---|
| | 2.5s linear ∞ | Active AI generation border |
| | 2s ease-in-out ∞ | Shimmer overlay during generation |
| | 1.5s ease-in-out ∞ | AI activity indicator dot |
| | 1.5s ease-in-out ∞ | Indeterminate progress bar |
| | 4s linear ∞ | Premium AI processing border |
| | 1.8s ease-in-out ∞ | Loading placeholder |
| | 4s linear ∞ | Rainbow gradient border |
| 类名 | 关键帧 | 时长 | 用途 |
|---|---|---|---|
| | 2.5s linear 无限循环 | AI生成中边框动效 |
| | 2s ease-in-out 无限循环 | 生成过程中闪烁遮罩 |
| | 1.5s ease-in-out 无限循环 | AI活动指示器圆点 |
| | 1.5s ease-in-out 无限循环 | 不确定进度条 |
| | 4s linear 无限循环 | 高级AI处理边框动效 |
| | 1.8s ease-in-out 无限循环 | 加载占位符 |
| | 4s linear 无限循环 | 彩虹渐变边框 |
Feedback Animations
反馈动效
| Class | Keyframes | Duration | Usage |
|---|---|---|---|
| | 0.6s ease-out | Generation complete |
| Ring burst scale + fading box-shadow | 0.6s spring | Positive rating |
| Scale 0→1.2→0 + rotate 0→360° | 0.5s spring | Sparkle on positive feedback |
| | 0.3s ease-out | Validation error |
| 类名 | 关键帧 | 时长 | 用途 |
|---|---|---|---|
| | 0.6s ease-out | 生成完成提示 |
| 环形爆发缩放+阴影淡出 | 0.6s spring | 正向评分反馈 |
| 缩放0→1.2→0 + 旋转0→360° | 0.5s spring | 正向反馈时的闪烁效果 |
| | 0.3s ease-out | 验证错误提示 |
Reduced Motion
简化动效模式
All animations respect — durations set to 0.01ms, animations disabled, scroll-behavior set to auto.
prefers-reduced-motion: reduce所有动效均遵循规则——时长设为0.01ms,动效禁用,滚动行为设为自动。
prefers-reduced-motion: reduce🧩 Responsive Breakpoints
🧩 响应式断点
| Breakpoint | Behavior |
|---|---|
| Sidebar: full-width overlay |
| Sidebar: slides out ( |
| Sidebar: persistent, content offset |
| 断点 | 行为 |
|---|---|
| 侧边栏:全屏覆盖层 |
| 侧边栏:滑出( |
| 侧边栏:固定显示,内容区域偏移 |
📜 Scrollbar
📜 滚动条
css
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); }Hide scrollbar:
.scrollbar-nonecss
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); }隐藏滚动条:
.scrollbar-none🔑 EaseUI Easing Curves
🔑 EaseUI缓动曲线
| Name | Value | Usage |
|---|---|---|
| Default | | Standard transitions (buttons, cards) |
| Spring | | Button press/release |
| Smooth decelerate | | Page transitions, reveal, device switch |
| Quick feedback | | Active press states |
| Toast exit | Paired | Toast notifications |
| 名称 | 值 | 用途 |
|---|---|---|
| 默认 | | 标准过渡(按钮、卡片) |
| 弹簧效果 | | 按钮按压/释放效果 |
| 平滑减速 | | 页面过渡、元素入场、设备切换 |
| 快速反馈 | | 激活按压状态 |
| 提示框退出 | 配对 | 提示通知框 |
📊 Design Knowledge Databases
📊 设计知识数据库
Searchable CSV data for UX patterns, accessibility, performance, and more. Grep these when you need specific guidance:
| File | Entries | Content | When to Use |
|---|---|---|---|
| ux-guidelines.csv | 99 | UX rules: smooth scroll, z-index, animation duration, loading states, form patterns | Any UX decision |
| web-interface.csv | 31 | WCAG: aria-labels, focus management, keyboard nav, semantic HTML | Accessibility work |
| react-performance.csv | 45 | Async waterfall, memo, rerender, cache, suspense, bundle optimization | Performance tuning |
| charts.csv | 25 | Chart type selection, color guidance, a11y notes, library recommendations | Data visualization |
| nextjs.csv | ~40 | SSR, routing, images, API routes, caching — EaseUI's stack | Next.js-specific patterns |
| icons.csv | 101 | Lucide icon name → keyword mapping | Finding the right icon |
Quick search example:
bash
undefined可搜索的CSV数据,包含UX模式、无障碍、性能优化等内容。需要特定指导时可检索这些文件:
| 文件 | 条目数 | 内容 | 使用场景 |
|---|---|---|---|
| ux-guidelines.csv | 99 | UX规则:平滑滚动、z-index、动效时长、加载状态、表单模式 | 任何UX决策场景 |
| web-interface.csv | 31 | WCAG规范:aria标签、焦点管理、键盘导航、语义化HTML | 无障碍开发工作 |
| react-performance.csv | 45 | 异步瀑布流、memo、重渲染、缓存、suspense、包体积优化 | 性能调优 |
| charts.csv | 25 | 图表类型选择、颜色指导、无障碍说明、库推荐 | 数据可视化 |
| nextjs.csv | ~40 | SSR、路由、图片、API路由、缓存——EaseUI技术栈 | Next.js专属模式 |
| icons.csv | 101 | Lucide图标名称→关键词映射 | 查找合适图标 |
快速检索示例:
bash
undefinedFind UX rules about animation
查找关于动效的UX规则
grep -i "animation" .agent/skills/easeui-core-components/data/ux-guidelines.csv
grep -i "animation" .agent/skills/easeui-core-components/data/ux-guidelines.csv
Find React performance rules about memo
查找关于memo的React性能规则
grep -i "memo" .agent/skills/easeui-core-components/data/react-performance.csv
grep -i "memo" .agent/skills/easeui-core-components/data/react-performance.csv
Find the right Lucide icon
查找合适的Lucide图标
grep -i "search" .agent/skills/easeui-core-components/data/icons.csv
---grep -i "search" .agent/skills/easeui-core-components/data/icons.csv
---🧩 Component Registry (NEVER REINVENT — REUSE FIRST)
🧩 组件注册表(切勿重复造轮子——优先复用)
🔴 Before creating ANY new component, check this registry. If it exists here, use it. Only create new components if confirmed absent.
🔴 创建任何新组件前,请先检查本注册表。如果组件已存在,请直接使用。仅在确认不存在时才创建新组件。
Shared Components (components/
)
components/共享组件(components/
)
components/| Component | File | Purpose |
|---|---|---|
| | Hover tooltip with positioning |
| | Notification toasts |
| | Loading placeholders |
| | Copy-to-clipboard with feedback |
| | Zero-data state with CTA |
| | React error boundary |
| | Page entrance animation |
| | Shortcut modal/handler |
| | Color picker dropdown |
| | Tag management popover |
| | Main app sidebar navigation |
| | AI generation progress overlay |
| | Background task status |
| | User feedback collection |
| | Plan upgrade prompt |
| | Design system export |
| | Notification panel |
| | Rate generated variants |
| | Token/cost tracking |
| | CSS property editor |
| | Animated AI indicator |
| | HTML layer tree panel |
| | Animated wave background |
| | Sound effects context provider |
| | Admin panel navigation |
| | Rich text floating menu |
| | Slash command menu |
| | Markdown WYSIWYG editor |
| 组件 | 文件 | 用途 |
|---|---|---|
| | 带定位的悬浮提示框 |
| | 通知提示框 |
| | 加载占位符 |
| | 带反馈的复制到剪贴板按钮 |
| | 空数据状态带CTA按钮 |
| | React错误边界 |
| | 页面入场动效 |
| | 快捷键模态框/处理器 |
| | 颜色选择器下拉框 |
| | 标签管理弹出框 |
| | 主应用侧边栏导航 |
| | AI生成进度覆盖层 |
| | 后台任务状态栏 |
| | 用户反馈收集模态框 |
| | 套餐升级提示框 |
| | 设计系统导出模态框 |
| | 通知面板 |
| | 评分生成变体 |
| | 令牌/成本追踪面板 |
| | CSS属性编辑器 |
| | 动画AI指示器 |
| | HTML层级树面板 |
| | 动画波浪背景 |
| | 音效上下文提供者 |
| | 管理面板侧边栏导航 |
| | 富文本浮动菜单 |
| | 斜杠命令菜单 |
| | Markdown所见即所得编辑器 |
Editor Components (components/editor/
)
components/editor/编辑器组件(components/editor/
)
components/editor/| Component | File | Purpose |
|---|---|---|
| | Canvas layer container |
| | Main canvas with pan/zoom |
| | Design system canvas |
| | Render artboard iframes |
| | Right-click menu |
| | Blue selection border |
| | Canvas background grid |
| | Overview minimap |
| | Artboard connection lines |
| | Zoom controls |
| | Circular control dial |
| | Editor right panel |
| | Slide-out drawer |
| | Prompt input panel |
| | Pick wireframe component |
| | Slide presentation mode |
| | Slide thumbnails |
| | Export slide options |
| | Design system card |
| 组件 | 文件 | 用途 |
|---|---|---|
| | 画布层级容器 |
| | 支持平移/缩放的主画布 |
| | 设计系统画布 |
| | 渲染画板iframe |
| | 右键菜单 |
| | 蓝色选择边框 |
| | 画布背景网格 |
| | 概览小地图 |
| | 画板连接线 |
| | 缩放控制栏 |
| | 圆形控制旋钮 |
| | 编辑器右侧面板 |
| | 滑出式抽屉 |
| | 提示输入面板 |
| | 选择线框组件模态框 |
| | 幻灯片演示模式 |
| | 幻灯片缩略图栏 |
| | 幻灯片导出选项 |
| | 设计系统卡片 |
Sidebar Panels (components/editor/sidebar-panels/
)
components/editor/sidebar-panels/侧边栏面板(components/editor/sidebar-panels/
)
components/editor/sidebar-panels/| Component | File | Purpose |
|---|---|---|
| | Selected variant details |
| | Project summary |
| | Empty canvas CTA |
| | Bulk actions |
| | Generation progress |
| | Inspector help |
| | DS component view |
| | DS overview |
| | DS foundations |
| | DS usage guidelines |
| | DS item detail |
| | DS empty state |
| 组件 | 文件 | 用途 |
|---|---|---|
| | 选中变体详情面板 |
| | 项目概览面板 |
| | 空画布CTA面板 |
| | 批量操作面板 |
| | 生成进度覆盖层 |
| | 编辑器帮助面板 |
| | 设计系统组件视图 |
| | 设计系统概览 |
| | 设计系统基础设置 |
| | 设计系统使用指南 |
| | 设计系统项详情 |
| | 设计系统空状态 |
Icons (components/icons/
) — 40 custom icons
components/icons/图标(components/icons/
)——40个自定义图标
components/icons/Search before creating:
grep -l "icon-name" app/src/components/icons/创建前先检索:
grep -l "icon-name" app/src/components/icons/📁 Source Files
📁 源文件
| File | Contains |
|---|---|
| globals.css | Main app design tokens, buttons, animations (799 lines) |
| design-system.css | PM Hub tokens, badges, cards, utilities (238 lines) |
| design-tokens.ts | Token parser (markdown → structured tokens) |
| color-scales.ts | OKLCH perceptual color scale generator |
| component-catalog.ts | 24 wireframe component templates |
| 文件 | 包含内容 |
|---|---|
| globals.css | 主应用设计令牌、按钮、动效(799行) |
| design-system.css | PM Hub令牌、徽章、卡片、工具类(238行) |
| design-tokens.ts | 令牌解析器(markdown → 结构化令牌) |
| color-scales.ts | OKLCH感知颜色色阶生成器 |
| component-catalog.ts | 24个线框组件模板 |
Done Condition
完成条件
Correct token/component identified + registry consulted before creating new components + sync script passes
已识别正确的令牌/组件 + 创建新组件前已查阅注册表 + 同步脚本执行通过