Accordion
Create accessible accordions inside Webflow without Webflow Interactions.
Webflow Libraries component
Implement in Webflow
Apply attributes to elements on the page
Below is a list of elements and options that are used to create this Attributes functionality. Click any of them to see more details.
Div Block
If there are 5 accordion items, this attribute should be placed on each item. If using a CMS Collection List, this attribute can be placed once on the Collection Item element.
Div Block
Div Block
This element is the arrow inside the accordion trigger.
This arrow element will receive the active class when the content is expanded.
Use Webflow native transition and transform CSS properties to create custom animations for the arrow.
For example, apply a rotate 180 degrees transform to the arrow element active state. This will create an arrow rotation effect.
The default class name is .is-active-accordion. This class is applied to the accordion, trigger, content, and arrow.
To keep the default class name, there is no need to add this attribute. To change the class name, set the value as the custom class name you want.
When an accordion has expanded content, any element with the fs-accordion-active class will receive this class as an active state.
Apply this attribute to the group element for the active class to cascade down to all elements in the accordion. All elements in the accordion will inherit the group settings.
fs-accordion-element = "accordion | trigger | content | group"
Group options
Apply the group attribute to enable group options.
By default, this option is set to false and all accordions can be opened without forced close.
Option
By default, this option is set to "1" to have all items closed on load set the value to "none".
NUMERIC_INDEX - A comma-separated list of indexes that define which accordions should be open.
For example,
"1" - The first accordion in the group is open.
"5" - The 5th accordion in the group is open.
"1, 4, 9" - The 1st, 4th, and 9th accordions in the group are open.
Working examples
See this solution working live in this Webflow project.
This component uses custom JavaScript to open and close. Custom attributes and additional custom JavaScript is added to this component to make it accessible.
Inside this component, there is an embed block that contains all of the custom code needed for this accordion to function.
We have full documentation for this accordion component here. You can use it to edit this component —or to build your own accessible accordion from scratch.
This component uses custom JavaScript to open and close. Custom attributes and additional custom JavaScript is added to this component to make it accessible.
Inside this component, there is an embed block that contains all of the custom code needed for this accordion to function.
We have full documentation for this accordion component here. You can use it to edit this component —or to build your own accessible accordion from scratch.