Tabs Element
Interact with Webflow's Tabs Element
Last updated
Interact with Webflow's Tabs Element
Last updated
This feature allows you to work with the Webflow tabs element programmatically.
Switch tabs programmatically- first, next, prev, and last, or go to a specific tab index
See the Deck Controller for a nocode control approach
Get the current tab index
Receive JavaScript events when the tab is changed, even if it is changed by code
Check the tabs demonstrations here-
Enhance navigation;
Link a button or other element to your tab element, to trigger navigation to the first, last, next, or previous tab. These elements can be anywhere on your page, including within the tab element. You can have as many of them as you like.
Programmatically navigate the tabs element using JavaScript.
Add dynamic page behaviors;
Do something on your page when a tab is changed.
Setup your tabs element using these attributes.
wfu-tabs
= ( name )Add the wfu-tabs
custom attribute to the a Tab element. Give it a unique name to identify that tabs element uniquely, e.g. tabs1
.
This makes the tab element accessible in code, and selectable by the other tabs custom attributes.
The Tabs element name should be unique within the page.
wfu-tab-default
attributeAdd the wfu-tab-default
custom attribute to a specific tab directly. This tab will be automatically selected on page load.
wfu-tab-name
= ( name )Optional. Add the wfu-tab-name
custom attribute to a specific tab directly. This will enable it to be selected as a named item using a deck controller. Alternatively, the tab number ( 1, 2, 3 ) can be used.
Tab names should be unique within the tabs element. Tab names are a discrete attribute so that they can be CMS bound attributes in the future.
2024-Feb-04 - Added nocode navigation support through Deck Controller elements.
2023-Aug-19 - Added tabChanged
callback event. Tabs has also been moved into the elements library, and is using our standarized "deck" interface which means the methods and properties here should align with similar deck-type elements such as the Slider.
First, add the library as detailed in Quick Start.
See above for details.
See above for details.