153 raintree-technology

hig-components-controls Skill

>- Apple HIG 关于选择与输入控件的指导,包括选择器、开关、滑块、步进器、分段控件、组合框、文本框、文本视图、标签、令牌输入框、虚拟键盘、评分指示器和仪表盘。当用户说“用选择器还是分段控件”、“我的表单应该长什么样”、“该用哪种键盘类型”、“开关和复选框怎么选”,或询问选择器设计、开关、切换、滑块、步进器、文本框、文本输入、分段控件、组合框、标签、令牌输入框、虚拟键盘、评分指示器、仪表盘、表单设计、输入校验或控

安装方式:把技能目录放入 ~/.claude/skills/(Claude Code)或在 claude.ai 设置中启用;也可复制右侧安装命令一键添加。

查看源码

技能指令原文(SKILL.md)

Apple HIG: Selection and Input Controls

Check for .claude/apple-design-context.md before asking questions. Use existing context and only ask for information not already covered.

Key Principles

  1. 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.
  1. Prefer standard system controls. Built-in controls provide consistency and accessibility. Custom controls introduce a learning curve and may break assistive features.
  1. Toggles for binary states. On or off. In Settings-style screens, changes take effect immediately. In modal forms, changes commit on confirmation.
  1. Segmented controls for mutually exclusive options. 2-5 items, roughly equal importance, short labels.
  1. Sliders for continuous values. When precise numeric input is not critical. Provide min/max labels or icons for range endpoints.
  1. Pickers for long option lists. Too many options for a segmented control. Works well for dates, times, structured data.
  1. Steppers for small, precise adjustments. Increment/decrement in fixed steps. Display current value next to the stepper with reasonable min/max bounds.
  1. Text fields for short, single-line input. Text views for multi-line. Configure keyboard type to match expected input (email, URL, number).
  1. Combo boxes: text input + selection list. macOS. Type a value or choose from a predefined list when custom values are valid.
  1. Token fields: discrete values as visual tokens. macOS. For email recipients, tags, or collections of discrete items.
  1. 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.

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 |

Output Format

  1. Control recommendation with rationale and why alternatives are less suitable.
  2. State management -- how the control communicates current state and whether changes apply immediately or on confirmation.
  3. Validation approach -- when to show errors and how to communicate rules.
  4. Accessibility -- labels, traits, hints for VoiceOver.

Questions to Ask

  1. What type of data? (Boolean, choice from fixed set, numeric, free-form text?)
  2. How many options?
  3. Which platforms? (Combo boxes and token fields are macOS-only)
  4. Settings screen or inline form?

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