用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/thedaviddias/ux-patterns-for-developers --skill expandable-text命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | expandable-text |
| description | Use when implementing show or hide additional text content on demand. |
| metadata | {"id":"expandable-text","category":"content-management","pattern":"Expandable Text","source":"uxpatterns.dev","url":"https://uxpatterns.dev/patterns/content-management/expandable-text","sourcePath":"apps/web/content/patterns/content-management/expandable-text.mdx"} |
Show or hide additional text content on demand
Expandable Text is a content management pattern that allows users to expand and collapse sections of text. This pattern improves readability by initially hiding non-essential content while keeping it accessible on demand. Expandable Text is commonly used to manage lengthy descriptions, article summaries, or additional details that are helpful but not immediately necessary. It helps users scan content efficiently while maintaining a clean and minimal interface.
Use Expandable Text when you need to manage lengthy content while keeping essential information visible. Common scenarios include:
references/pattern.md, then choose the smallest viable variation.Required ARIA attributes:
aria-expanded="false" on the button (updated dynamically).aria-controls="id-of-content" to link the button to the expandable content.hidden attribute on the expandable content when collapsed.aria-live="polite" if the content update needs to be announced.For full implementation detail, examples, and testing notes, see references/pattern.md.
Pattern page: https://uxpatterns.dev/patterns/content-management/expandable-text