AgentSkillsCN

common-patterns

常见的 UI 模式(表单、对话框、通知与表格)。关键词:表单、对话框、模态框、通知、表格、UI 模式。

SKILL.md
--- frontmatter
name: common-patterns
description: "Common UI patterns (forms, dialogs, notifications, and tables). Keywords: forms, dialogs, modals, notifications, tables, ui patterns."

Common Patterns

This skill lists common UI patterns and recommended defaults.


Forms

  • Validate at the boundary (schema-first where possible).
  • Display field-level errors and a single top-level error summary for submission failures.

Dialogs / modals

  • Trap focus inside the dialog.
  • Ensure ESC closes the dialog (unless forbidden for safety reasons).
  • Restore focus to the triggering element on close.

Notifications

  • Prefer a single notification mechanism (snackbar/toast).
  • Use success messages sparingly; highlight failures and required actions.

Tables / grids

  • Prefer server-side pagination for large datasets.
  • Keep sorting/filtering state in the URL for shareability (when appropriate).