hig-components-controls – skill Lập trình cho agent AI
Chọn và đánh giá các điều khiển chọn và nhập liệu của Apple: toggle, segmented control, slider, picker, stepper, text field, label và hành vi bàn phím.
Cài skill hig-components-controls bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/hig-components-controls-1afbd.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /hig-components-controls – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/hig-components-controls-1afbd.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $hig-components-controls – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/hig-components-controls-1afbd.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /hig-components-controls – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/hig-components-controls-1afbd.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /hig-components-controls – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
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.
2. Prefer standard system controls. Built-in controls provide consistency and accessibility. Custom controls introduce a learning curve and may break assistive features.
3. Toggles for binary states. On or off. In Settings-style screens, changes take effect immediately. In modal forms, changes commit on confirmation.
4. Segmented controls for closely related choices. Usually a small set; macOS also supports multiple selection and momentary actions. Keep a control’s selection/action behavior consistent.
5. Sliders for continuous values. When precise numeric input is not critical. Provide min/max labels or icons for range endpoints.
6. Pickers for long option lists. Too many options for a segmented control. Works well for dates, times, structured data.
7. Steppers for small, precise adjustments. Increment/decrement in fixed steps. Display current value next to the stepper with reasonable min/max bounds.
8. Text fields for short, single-line input. Text views for multi-line. Configure keyboard type to match expected input (email, URL, number).
9. Combo boxes: text input + selection list. macOS. Type a value or choose from a predefined list when custom values are valid.
10. Token fields: discrete values as visual tokens. macOS. For email recipients, tags, or collections of discrete items.
11. 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](references/controls.md) | System controls | Control Center, Lock Screen and Action button controls |
| [toggles.md](references/toggles.md) | Toggles | On/off, immediate effect |
| [segmented-controls.md](references/segmented-controls.md) | Segmented controls | 2-5 options, equal weight |
| [sliders.md](references/sliders.md) | Sliders | Continuous range, min/max labels |
| [steppers.md](references/steppers.md) | Steppers | Fixed steps, bounded values |
| [pickers.md](references/pickers.md) | Pickers | Dates, times, long option sets |
| [combo-boxes.md](references/combo-boxes.md) | Combo boxes | macOS, type or select, custom values |
| [text-fields.md](references/text-fields.md) | Text fields | Short input, keyboard types, validation |
| [text-views.md](references/text-views.md) | Text views | Multi-line, comments, descriptions |
| [labels.md](references/labels.md) | Labels | Placement, VoiceOver support |
| [token-fields.md](references/token-fields.md) | Token fields | macOS, chips, tags, recipients |
| [virtual-keyboards.md](references/virtual-keyboards.md) | Virtual keyboards | Email, URL, number keyboard types |
| [rating-indicators.md](references/rating-indicators.md) | Rating indicators | Star ratings, display-only |
| [gauges.md](references/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](https://raintree.technology) · [More developer tools](https://raintree.technology)*
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Example
User request:
> Choose between a picker and segmented control for five related filters in an iPhone app, and explain state and VoiceOver behavior.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Reference scope
Bundled Apple documentation is a static snapshot; check the linked primary page and target OS/API availability before platform-specific implementation. The controls.md page concerns WidgetKit system controls, not every in-app input control. The rating-indicator reference describes macOS NSLevelIndicator, which can be editable; a custom rating UI on other platforms is a separate design. Visual labels do not replace accessibility names. Keyboard type and formatters assist input but do not replace locale-aware validation, and secure fields do not encrypt stored/transmitted data. No Apple runtime or image-asset availability was tested here.
Skill liên quan
- skill-tester – Xác thực, kiểm thử và chấm điểm chất lượng các skill trong hệ sinh thái claude-skills…
- hono – Xây dựng web API và ứng dụng full-stack siêu nhanh với Hono — chạy trên Cloudflare…
- html-injection-testing – Phát hiện và khai thác lỗ hổng HTML injection cho phép kẻ tấn công chèn nội dung HTML…
- http-status-code-tester – Trình kiểm tra mã trạng thái HTTP. Dùng khi làm việc với một hoặc nhiều URL HTTP(S).
- hubspot-integration – Mẫu chuyên sâu để tích hợp HubSpot CRM, gồm xác thực OAuth, đối tượng CRM, association…
- hugging-face-cli – CLI (`hf`) của Hugging Face Hub để tải xuống, tải lên và quản lý model, dataset, space…
- hugging-face-community-evals – Chạy đánh giá cho model trên Hugging Face Hub bằng inspect-ai và lighteval trên phần…
- hugging-face-gradio – Xây dựng giao diện web và demo Gradio bằng Python. Dùng khi tạo hoặc chỉnh sửa ứng dụng…