chrome-extension-ui
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseChrome Extensions UX/UI Best Practices
Chrome扩展UX/UI最佳实践
Comprehensive UX/UI design guide for Chrome Extensions, optimized for Manifest V3. Contains 42 rules across 8 categories, prioritized by impact to guide extension UI development and code review.
这是一份针对Chrome扩展的全面UX/UI设计指南,已针对Manifest V3优化。指南包含8个类别共42条规则,按影响优先级排序,可用于指导扩展UI开发与代码评审。
When to Apply
适用场景
Reference these guidelines when:
- Building new Chrome extension user interfaces
- Choosing between popup, side panel, or content script UI
- Implementing accessible, keyboard-navigable interfaces
- Designing loading states, error handling, and feedback patterns
- Creating options pages and settings persistence
在以下场景中可参考本指南:
- 构建新的Chrome扩展用户界面
- 在弹窗、侧边面板或内容脚本UI之间做选择
- 实现支持键盘导航的无障碍界面
- 设计加载状态、错误处理与反馈模式
- 创建选项页并实现设置持久化
Rule Categories by Priority
按优先级划分的规则类别
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Component Selection | CRITICAL | |
| 2 | Accessibility & Navigation | CRITICAL | |
| 3 | Popup Design | HIGH | |
| 4 | Side Panel UX | HIGH | |
| 5 | Content Script UI | MEDIUM-HIGH | |
| 6 | Visual Feedback | MEDIUM | |
| 7 | Options & Settings | MEDIUM | |
| 8 | Icons & Branding | LOW-MEDIUM | |
| 优先级 | 类别 | 影响程度 | 前缀 |
|---|---|---|---|
| 1 | 组件选择 | 关键 | |
| 2 | 无障碍与导航 | 关键 | |
| 3 | 弹窗设计 | 高 | |
| 4 | 侧边面板体验 | 高 | |
| 5 | 内容脚本UI | 中高 | |
| 6 | 视觉反馈 | 中 | |
| 7 | 选项与设置 | 中 | |
| 8 | 图标与品牌 | 中低 | |
Quick Reference
快速参考
1. Component Selection (CRITICAL)
1. 组件选择(关键)
- - Choose Side Panel for Persistent Tasks
comp-popup-vs-sidepanel - - Use Content Scripts for In-Page UI
comp-content-script-ui - - Design for Single Purpose
comp-single-purpose - - Request Minimal Permissions
comp-minimal-permissions - - Provide Descriptive Action Tooltips
comp-action-tooltip
- - 持久化任务优先选择侧边面板
comp-popup-vs-sidepanel - - 内容脚本用于页面内嵌UI
comp-content-script-ui - - 按单一用途设计
comp-single-purpose - - 请求最小权限
comp-minimal-permissions - - 提供描述性操作提示
comp-action-tooltip
2. Accessibility & Navigation (CRITICAL)
2. 无障碍与导航(关键)
- - Enable Complete Keyboard Navigation
access-keyboard-navigation - - Maintain Visible Focus Indicators
access-focus-visible - - Use ARIA Labels for Icon-Only Buttons
access-aria-labels - - Ensure Sufficient Color Contrast
access-color-contrast - - Avoid Keyboard Focus Traps
access-focus-trap - - Use Semantic HTML Elements
access-semantic-html
- - 支持完整键盘导航
access-keyboard-navigation - - 保持可见的焦点指示器
access-focus-visible - - 纯图标按钮使用ARIA标签
access-aria-labels - - 确保足够的色彩对比度
access-color-contrast - - 避免键盘焦点陷阱
access-focus-trap - - 使用语义化HTML元素
access-semantic-html
3. Popup Design (HIGH)
3. 弹窗设计(高)
- - Design Within Popup Size Limits
popup-size-constraints - - Render Popup Content Instantly
popup-instant-render - - Make the Primary Action Obvious
popup-primary-action - - Handle Popup Auto-Close Gracefully
popup-auto-close - - Keep JavaScript in External Files
popup-external-js - - Use Dynamic Popups for State-Based UI
popup-dynamic-switch
- - 在弹窗尺寸限制内设计
popup-size-constraints - - 即时渲染弹窗内容
popup-instant-render - - 突出显示主要操作
popup-primary-action - - 优雅处理弹窗自动关闭
popup-auto-close - - 将JavaScript放在外部文件中
popup-external-js - - 基于状态使用动态弹窗
popup-dynamic-switch
4. Side Panel UX (HIGH)
4. 侧边面板体验(高)
- - Design Non-Distracting Side Panels
panel-non-distracting - - Choose Tab-Specific vs Window-Wide Panels
panel-tab-vs-window - - Design for Variable Panel Widths
panel-responsive-width - - Sync Panel Content with Page Context
panel-page-context - - Lazy Load Panel Sections
panel-lazy-sections
- - 设计无干扰的侧边面板
panel-non-distracting - - 选择标签页专属或全窗口面板
panel-tab-vs-window - - 适配可变面板宽度
panel-responsive-width - - 同步面板内容与页面上下文
panel-page-context - - 懒加载面板分区
panel-lazy-sections
5. Content Script UI (MEDIUM-HIGH)
5. 内容脚本UI(中高)
- - Use Shadow DOM for Style Isolation
inject-shadow-dom - - Use Maximum Z-Index for Overlays
inject-z-index - - Inject UI After DOM Ready
inject-document-ready - - Use Unique IDs to Prevent Conflicts
inject-unique-ids - - Clean Up Injected Elements on Removal
inject-cleanup
- - 使用Shadow DOM实现样式隔离
inject-shadow-dom - - 叠加层使用最大Z-index
inject-z-index - - DOM加载完成后注入UI
inject-document-ready - - 使用唯一ID避免冲突
inject-unique-ids - - 移除时清理注入元素
inject-cleanup
6. Visual Feedback (MEDIUM)
6. 视觉反馈(中)
- - Show Loading States for Async Operations
feedback-loading-states - - Write Actionable Error Messages
feedback-error-messages - - Use Badge for At-a-Glance Status
feedback-badge-status - - Confirm Successful Actions
feedback-success-confirmation - - Use Notifications Sparingly
feedback-notifications - - Show Progress for Long Operations
feedback-progress-indication
- - 异步操作显示加载状态
feedback-loading-states - - 编写可操作的错误提示
feedback-error-messages - - 使用徽章展示概览状态
feedback-badge-status - - 确认操作成功
feedback-success-confirmation - - 谨慎使用通知
feedback-notifications - - 长时操作显示进度
feedback-progress-indication
7. Options & Settings (MEDIUM)
7. 选项与设置(中)
- - Use Embedded Options for Simple Settings
options-embedded-page - - Sync Settings Across Devices
options-sync-storage - - Auto-Save Settings on Change
options-auto-save - - Provide Sensible Default Settings
options-sensible-defaults
- - 简单设置使用内嵌选项页
options-embedded-page - - 跨设备同步设置
options-sync-storage - - 更改设置时自动保存
options-auto-save - - 提供合理的默认设置
options-sensible-defaults
8. Icons & Branding (LOW-MEDIUM)
8. 图标与品牌(中低)
- - Provide All Required Icon Sizes
brand-icon-sizes - - Design a Distinctive Toolbar Icon
brand-distinctive-icon - - Keep Badge Text Under 4 Characters
brand-badge-text - - Maintain Consistent Visual Style
brand-consistent-styling - - Create Quality Web Store Assets
brand-web-store-assets
- - 提供所有要求的图标尺寸
brand-icon-sizes - - 设计独特的工具栏图标
brand-distinctive-icon - - 徽章文本不超过4个字符
brand-badge-text - - 保持视觉风格一致
brand-consistent-styling - - 创建高质量应用商店资源
brand-web-store-assets
How to Use
使用方法
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
阅读单个参考文件获取详细说明与代码示例:
- 章节定义 - 类别结构与影响级别
- 规则模板 - 添加新规则的模板
Reference Files
参考文件
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
| 文件 | 描述 |
|---|---|
| references/_sections.md | 类别定义与排序 |
| assets/templates/_template.md | 新规则模板 |
| metadata.json | 版本与参考信息 |