Communitygithub.com

COTA-App/LandingPage

Apple HIG 对选择与输入控件的指导,包括选择器、开关、滑块、步进器、分段控件、组合框、文本字段、文本视图、标签、令牌字段、虚拟键盘、评分指示器和仪表盘。请在使用此技能时,如果用户提到“选择器或分段控件”、“我的表单应该是什么样式”、“我应该使用哪种键盘类型”、“开关与复选框对比”,或询问关于选择器设计、开关、切换、滑块、步进器、文本字段、文本输入、分段控件、组合框、标签、令牌字段、虚拟键盘、评分指示器、仪表盘、表单设计、输入验证或控件状态管理的问题。交叉引用:hig-components-menus、hig-components-dialogs、hig-components-search。

LandingPage 是什么?

这是一个专注于 Apple 人机界面指南(HIG)中关于选择与输入控件的技能。它提供了对多种控件的详细指导,包括开关、分段控件、滑块、步进器、选择器、文本字段、文本视图、组合框、标签、令牌字段、虚拟键盘、评分指示器和仪表盘。该技能帮助开发者理解何时以及如何使用每个控件,强调清晰的状态显示、偏好使用标准系统控件以保持一致性,并涵盖了状态管理、验证方法和无障碍支持。它支持 iOS、iPadOS、macOS 和 visionOS 等平台,并且对于组合框和令牌字段等 macOS 特有控件提供了特别说明。技能包含一个参考索引,链接到更详细的技术文档,以及一个输出格式,用于在给出控件建议时提供理由、状态管理、验证方法和无障碍细节。它还会询问关键问题,以基于数据类型、选项数量、目标平台和上下文(设置屏幕与内联表单)来推荐最合适的控件。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/COTA-App/LandingPage/tree/HEAD/.claude/skills/hig-components-controls

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Apple HIG:选择与输入控件

在提问前,请检查是否存在 .claude/apple-design-context.md 文件。优先使用现有上下文,仅当信息未涵盖时才询问。

关键原则

  1. 清晰显示当前状态。 用户必须始终看到所选内容。开关显示开/关,分段控件高亮显示活动段,选择器显示当前选择。

  2. 优先使用标准系统控件。 内置控件提供一致性和可访问性。自定义控件会增加学习曲线,并可能破坏辅助功能。

  3. 开关用于二元状态。 开启或关闭。在设置类型的屏幕中,更改会立即生效。在模态表单中,更改在确认后提交。

  4. 分段控件用于互斥选项。 2-5 个项目,重要性大致相等,标签简短。

  5. 滑块用于连续值。 当不要求精确数字输入时。为范围端点提供最小值/最大值标签或图标。

  6. 选择器用于长选项列表。 选项过多以至于不适合分段控件。适用于日期、时间和结构化数据。

  7. 步进器用于微小、精确的调整。 以固定步长递增/递减。在步进器旁边显示当前值,并设置合理的最大值/最小值边界。

  8. 文本字段用于短文本、单行输入。 文本视图用于多行输入。配置键盘类型以匹配预期的输入内容(电子邮件、URL、数字)。

  9. 组合框:文本输入 + 选择列表。 仅限 macOS。当自定义值有效时,可输入值或从预定义列表中选择。

  10. 令牌字段:将离散值显示为视觉令牌。 仅限 macOS。用于电子邮件收件人、标签或离散项目的集合。

  11. 仪表盘和评分指示器显示数值。 仪表盘显示某个范围内的值。评分指示器显示评分(通常为星标)。仅用于显示;使用交互式变体进行输入。

参考索引

参考文档主题关键内容
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虚拟键盘电子邮件、URL、数字键盘类型
rating-indicators.md评分指示器星标评分、仅用于显示
gauges.md仪表盘水平指示器、范围显示

输出格式

  1. 控件推荐及理由,并解释替代方案为何不适用。
  2. 状态管理——控件如何传达当前状态,以及更改是立即生效还是在确认后生效。
  3. 验证方法——何时显示错误以及如何传达规则。
  4. 可访问性——为 VoiceOver 提供的标签、特征和提示。

需要询问的问题

  1. 数据类型是什么?(布尔型、固定选项、数字型、自由文本?)
  2. 有多少个选项?
  3. 目标平台是什么?(组合框和令牌字段仅限 macOS)
  4. 是在设置屏幕还是内联表单中使用?

相关技能

  • hig-components-menus——按钮和弹出式按钮,可补充选择控件
  • hig-components-dialogs——包含表单的页面和弹出窗口
  • hig-components-search——搜索字段共享文本输入模式
  • hig-inputs——键盘、指针、手势与控件的交互
  • hig-foundations——用于控件样式的排版、颜色和布局

由 Raintree Technology 构建 · 更多开发者工具

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

COTA-App/LandingPage

>- Apple Human Interface Guidelines for content display components. Use this skill when the user asks about "charts component", "collection view", "image view", "web view", "color well", "image well", "activity view", "lockup", "data visualization", "content display", displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says "how should I display charts", "what's the best way to show images", "should I use a web view", "how do I build a grid of items", "what component shows media", or "how do I present a share sheet". Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.

COTA-App/LandingPage

>- Apple Human Interface Guidelines for layout and navigation components. Use this skill when the user asks about "sidebar", "split view", "tab bar", "tab view", "scroll view", "window design", "panel", "list view", "table view", "column view", "outline view", "navigation structure", "app layout", "boxes", "ornaments", or organizing content hierarchically in Apple apps. Also use when the user says "how should I organize my app", "what navigation pattern should I use", "my layout breaks on iPad", "how do I build a sidebar", "should I use tabs or a sidebar", or "my app doesn't adapt to different screen sizes". Cross-references: hig-foundations for layout/spacing principles, hig-platforms for platform-specific navigation, hig-patterns for multitasking and full-screen, hig-components-content for content display.

COTA-App/LandingPage

>- Apple Human Interface Guidelines design foundations. Use this skill when the user asks about "HIG color", "Apple typography", "SF Symbols", "dark mode guidelines", "accessible design", "Apple design foundations", "app icon", "layout guidelines", "materials", "motion", "privacy", "right to left", "RTL", "inclusive design", branding, images, spatial layout, or writing style. Also use when the user says "my colors look wrong in dark mode", "what font should I use", "is my app accessible enough", "how do I support Dynamic Type", "what contrast ratio do I need", "how do I pick system colors", or "my icons don't match the system style". Cross-references: hig-platforms for platform-specific guidance, hig-patterns for interaction patterns, hig-components-layout for structural components, hig-components-content for display.

COTA-App/LandingPage

>- Apple Human Interface Guidelines interaction and UX patterns. Use this skill when the user asks about "onboarding flow", "user onboarding", "app launch", "loading state", "drag and drop", "search pattern", "settings design", "notifications", "modality", "multitasking", "feedback pattern", "haptics", "undo redo", "file management", data entry, sharing, collaboration, full screen, audio, video, haptic feedback, ratings, printing, help, or account management in Apple apps. Also use when the user says "how should onboarding work", "my app takes too long to load", "should I use a modal here", "how do I handle errors", "when should I ask for permissions", "how to show progress", or "what's the right way to confirm a delete". Cross-references: hig-foundations for underlying principles, hig-platforms for platform specifics, hig-components-layout for navigation, hig-components-content for data display.

相关技能