hig-components-controls
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseApple HIG: Selection and Input Controls
Apple HIG: 选择与输入控件
Check for before asking questions. Use existing context and only ask for information not already covered.
.claude/apple-design-context.md在提问前请查看 ,利用已有上下文,仅询问未涵盖的信息。
.claude/apple-design-context.mdKey Principles
核心原则
-
Clear current state. Users must always see what is selected. Toggles show on/off, segmented controls highlight the active segment, pickers display the current selection.
-
Prefer standard system controls. Built-in controls provide consistency and accessibility. Custom controls introduce a learning curve and may break assistive features.
-
Toggles for binary states. On or off. In Settings-style screens, changes take effect immediately. In modal forms, changes commit on confirmation.
-
Segmented controls for mutually exclusive options. 2-5 items, roughly equal importance, short labels.
-
Sliders for continuous values. When precise numeric input is not critical. Provide min/max labels or icons for range endpoints.
-
Pickers for long option lists. Too many options for a segmented control. Works well for dates, times, structured data.
-
Steppers for small, precise adjustments. Increment/decrement in fixed steps. Display current value next to the stepper with reasonable min/max bounds.
-
Text fields for short, single-line input. Text views for multi-line. Configure keyboard type to match expected input (email, URL, number).
-
Combo boxes: text input + selection list. macOS. Type a value or choose from a predefined list when custom values are valid.
-
Token fields: discrete values as visual tokens. macOS. For email recipients, tags, or collections of discrete items.
-
Gauges and rating indicators display values. Gauges show a value within a range. Rating indicators show ratings (often stars). Display-only; use interactive variants for input.
-
清晰显示当前状态。用户必须始终能看到已选中的内容。开关需展示开/关状态,分段控件需高亮激活的分段,选择器需显示当前选中项。
-
优先使用标准系统控件。内置控件能提供一致性和可访问性。自定义控件会增加学习成本,还可能破坏辅助功能。
-
开关用于二元状态。开或关。在设置类界面中,更改会立即生效;在模态表单中,更改需确认后提交。
-
分段控件用于互斥选项。2-5个选项,权重大致相等,标签简短。
-
滑块用于连续数值。当不需要精确数值输入时使用。需为范围端点提供最小/最大值标签或图标。
-
选择器用于长选项列表。当选项过多不适合用分段控件时使用,适用于日期、时间、结构化数据选择。
-
步进器用于小幅度精确调整。以固定步长增减数值。需在步进器旁显示当前值,并设置合理的最小/最大值限制。
-
文本框用于短单行输入。文本视图用于多行输入。需根据预期输入类型配置键盘(如邮箱、网址、数字键盘)。
-
组合框:文本输入+选择列表。仅适用于macOS。当允许自定义值时,用户可输入值或从预定义列表中选择。
-
令牌字段:以可视化令牌呈现离散值。仅适用于macOS。用于邮箱收件人、标签或离散项集合。
-
仪表与评分指示器用于展示数值。仪表显示范围内的数值,评分指示器展示评分(通常为星级)。仅作展示用途;如需交互输入,请使用交互式变体。
Reference Index
参考索引
| Reference | Topic | Key content |
|---|---|---|
| controls.md | General controls | States, affordance, system controls |
| toggles.md | Toggles | On/off, immediate effect |
| segmented-controls.md | Segmented controls | 2-5 options, equal weight |
| sliders.md | Sliders | Continuous range, min/max labels |
| steppers.md | Steppers | Fixed steps, bounded values |
| pickers.md | Pickers | Dates, times, long option sets |
| combo-boxes.md | Combo boxes | macOS, type or select, custom values |
| text-fields.md | Text fields | Short input, keyboard types, validation |
| text-views.md | Text views | Multi-line, comments, descriptions |
| labels.md | Labels | Placement, VoiceOver support |
| token-fields.md | Token fields | macOS, chips, tags, recipients |
| virtual-keyboards.md | Virtual keyboards | Email, URL, number keyboard types |
| rating-indicators.md | Rating indicators | Star ratings, display-only |
| gauges.md | Gauges | Level indicators, range display |
| 参考资料 | 主题 | 核心内容 |
|---|---|---|
| controls.md | 通用控件 | 状态、交互提示、系统控件 |
| toggles.md | 开关 | 开/关状态、即时生效 |
| segmented-controls.md | 分段控件 | 2-5个选项、权重均等 |
| sliders.md | 滑块 | 连续范围、最小/最大值标签 |
| steppers.md | 步进器 | 固定步长、数值限制 |
| pickers.md | 选择器 | 日期、时间、长选项集 |
| combo-boxes.md | 组合框 | macOS专属、输入或选择、自定义值 |
| text-fields.md | 文本框 | 短输入、键盘类型、验证 |
| text-views.md | 文本视图 | 多行输入、评论、描述 |
| labels.md | 标签 | 布局、VoiceOver 支持 |
| token-fields.md | 令牌字段 | macOS专属、标签块、收件人管理 |
| virtual-keyboards.md | 虚拟键盘 | 邮箱、网址、数字键盘类型 |
| rating-indicators.md | 评分指示器 | 星级评分、仅展示 |
| gauges.md | 仪表 | 等级指示器、范围展示 |
Output Format
输出格式
- Control recommendation with rationale and why alternatives are less suitable.
- State management -- how the control communicates current state and whether changes apply immediately or on confirmation.
- Validation approach -- when to show errors and how to communicate rules.
- Accessibility -- labels, traits, hints for VoiceOver.
- 控件推荐及理由,说明为何其他替代方案不太合适。
- 状态管理——控件如何传达当前状态,以及更改是即时生效还是需确认后生效。
- 验证方式——何时显示错误,以及如何传达规则。
- 无障碍支持——标签、特性、VoiceOver 提示。
Questions to Ask
需询问的问题
- What type of data? (Boolean, choice from fixed set, numeric, free-form text?)
- How many options?
- Which platforms? (Combo boxes and token fields are macOS-only)
- Settings screen or inline form?
- 数据类型是什么?(布尔值、固定集合选择、数值、自由文本?)
- 有多少个选项?
- 针对哪些平台?(组合框和令牌字段仅适用于macOS)
- 是设置界面还是内联表单?
Related Skills
相关技能
- hig-components-menus -- Buttons and pop-up buttons complementing selection controls
- hig-components-dialogs -- Sheets and popovers containing forms
- hig-components-search -- Search fields sharing text input patterns
- hig-inputs -- Keyboard, pointer, gesture interactions with controls
- hig-foundations -- Typography, color, layout for control styling
Built by Raintree Technology · More developer tools
- hig-components-menus —— 与选择控件互补的按钮和弹出按钮
- hig-components-dialogs —— 包含表单的表单页和弹出框
- hig-components-search —— 共享文本输入模式的搜索框
- hig-inputs —— 控件的键盘、指针、手势交互
- hig-foundations —— 控件样式的排版、颜色、布局
由 Raintree Technology 构建 · 更多开发者工具