Description
iron-collapse is a Polymer web component that creates a collapsible block of content. By default the content starts collapsed, and you show or hide it by setting the opened property or calling the toggle method. The element changes its max-height or max-width to animate the reveal, so the README advises putting padding, margins and borders on an inner div instead of on the collapsible element itself. The README also notes that the aria-expanded attribute belongs on the button that controls the area, not on the area. A custom property sets the animation length, and it defaults to 300 milliseconds. The element can be used in plain HTML files and inside Polymer 3 elements, and the README includes setup steps for both. It is part of the Polymer Elements collection, with a demo and documentation linked from the README. The repository also explains how to run the tests and the demo locally for anyone who wants to contribute. It suits developers building with Polymer who need a show-and-hide section.…
Highlights
- Collapsible content block for Polymer
- Show or hide with opened or toggle()
- Animation length set by a custom property
- Works in HTML files and Polymer 3 elements
- Demo and tests you can run locally
Ratings & Reviews
No ratings yet
Be the first to rate @polymer/iron-collapse.
People also visit
@polymer/iron-collapse FAQ
What is iron-collapse?
A Polymer web component that wraps content in a block that can be collapsed and expanded.
How do I open and close it?
Set the opened property, or call toggle() on the element.
How do I change the animation speed?
Set the --iron-collapse-transition-duration custom property. It defaults to 300ms.
How do I install it?
The README gives installation steps for plain HTML files and for Polymer 3 elements.
Where can I see a demo?
The README links to a demo and to the documentation.
What are the best @polymer/iron-collapse alternatives?
Popular alternatives to @polymer/iron-collapse include @webcomponents/custom-elements, react-css-collapse and react-collapsible. See all @polymer/iron-collapse alternatives















