一键导入
expandable-text
Use when implementing show or hide additional text content on demand.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when implementing show or hide additional text content on demand.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when implementing help users understand their current location.
Use when implementing expand and collapse content sections.
Use when implementing user account configuration and preferences.
Use when implementing social activity and updates stream.
Use when implementing conversational AI chat interfaces.
Use when implementing handling AI-specific errors.
| 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