This is a basic expand/collapse widget that shows and hides content when the header is clicked. The transition is smooth and the icon rotates to indicate the state.
You can customize the max-height property in the CSS to accommodate different content sizes.
This widget supports multiple instances on the same page. Each example is independent and maintains its own state.
The JavaScript function handles the toggle logic and can be extended for more complex interactions.