Skip to content
cccskills
FreePublished on GitHub

expandable-text

Use when implementing show or hide additional text content on demand.

The English summary is being prepared. Showing the original description.

See how to install

Files included (2)

  • SKILL.md3.2 KB
  • references/pattern.md16.4 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Expandable Text

Show or hide additional text content on demand

What it solves

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.

When to use

Use Expandable Text when you need to manage lengthy content while keeping essential information visible. Common scenarios include:

  • Summarizing content – Showing a short preview of a longer article, product description, or FAQ answer.
  • Reducing page clutter – Keeping the interface clean by hiding secondary details.
  • Improving mobile usability – Managing screen space efficiently on smaller devices.
  • Progressive disclosure – Revealing additional information only when needed.
  • Enhancing readability – Preventing information overload while keeping details accessible.

When to avoid

  • For critical information – Users should not need to expand content to access essential details, such as pricing, terms, or important warnings.
  • For frequently accessed content – If most users expand the content, it may be better to display it by default.
  • When full content is needed upfront – Avoid hiding information that helps users make informed decisions quickly.

Implementation workflow

  1. Confirm the pattern matches the problem and constraints before copying the example.
  2. Start from the anatomy and examples in references/pattern.md, then choose the smallest viable variation.
  3. Apply accessibility, performance, and interaction guardrails before layering visual polish.
  4. Use the testing guidance to verify behavior across keyboard, screen reader, responsive, and failure scenarios.

Accessibility guardrails

ARIA Attributes

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.

Screen Reader Support

  • Ensure that the expanded content is properly announced by screen readers.
  • Use aria-live="polite" if the content update needs to be announced.

Related patterns


For full implementation detail, examples, and testing notes, see references/pattern.md.

Pattern page: https://uxpatterns.dev/patterns/content-management/expandable-text

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Use when implementing expand and collapse content sections.

The English summary is being prepared. Showing the original description.

thedaviddias/ux-patterns-for-developers266Updated Oct 5, 2026

Use when implementing user account configuration and preferences.

The English summary is being prepared. Showing the original description.

thedaviddias/ux-patterns-for-developers266Updated Oct 5, 2026

Use when implementing social activity and updates stream.

The English summary is being prepared. Showing the original description.

thedaviddias/ux-patterns-for-developers266Updated Oct 5, 2026

Use when implementing conversational AI chat interfaces.

The English summary is being prepared. Showing the original description.

thedaviddias/ux-patterns-for-developers266Updated Oct 5, 2026

Use when implementing handling AI-specific errors.

The English summary is being prepared. Showing the original description.

thedaviddias/ux-patterns-for-developers266Updated Oct 5, 2026

Use when implementing loading states for AI operations.

The English summary is being prepared. Showing the original description.

thedaviddias/ux-patterns-for-developers266Updated Oct 5, 2026

See all skills by thedaviddias

Report a problem with this skill