Expand/Collapse Widget Demo

Basic Information

This is the basic expand/collapse widget. Click the header to toggle the content visibility. The animation provides smooth transitions for better user experience.

  • Item 1: First point of information
  • Item 2: Second point of information
  • Item 3: Third point of information

Advanced Features

Technical Details

This widget uses CSS transitions for smooth expand/collapse animations. The JavaScript function handles the toggle logic by adding/removing the 'expanded' class.

Key Features:
Feature Description
Smooth Animation CSS transition for max-height property
Icon Rotation Visual feedback with rotating arrow
Keyboard Accessible Can be activated with Enter/Space keys

Usage Guidelines

Best Practices

Do:
  • Use for secondary content
  • Keep headers descriptive
  • Ensure content is relevant
Don't:
  • Hide critical information
  • Make headers too long
  • Nest too many levels deep

This widget is particularly useful for FAQs, product specifications, and collapsible form sections.