Tabs
Current Prototype is v1.2.0
Features
Assemble any arrangement of tabs and tab content
Use any component as tab content
Build mode support
As of v1.1.0 ( unreleased )-
If no Initial Tab Identifier is specified, the first tab is selected automatically
Full CMS compatibility; create your tabstrip from the CMS
Use two collection lists, one for the tabs, one for the content panes. Bind the slug as the Tab Identifier.
Mixed static + CMS tabs also works
Design
This is a 1:1 recreation of Webflow's native tabs element, consisting of 3 components;
Tabs component
Tabs | Tab component
Tabs | Content component
The are assembled together using slots to create the tabs component.
Works with Webflow's build mode. Simply create the inner components you want to slot within each Tabs | Content component.
Video walkthrough-
Usage Notes
Add your Tabs component to the form.
In the Tabs slot, add as many Tabs | Tab components as you like
In the Contens slot, add as many Tabs | Content components as you like
Connect them together by defining a matching Tab Identifier property like
Tab 1
,Tab 2
, etc. See the video for reference.
Tabs
Component
Tabs
Component Properties;
Initial Tab Identifier - use to select the initial tab
As of v1.1.0, if the Initial Tab Identifier is blank, the first tab will be selected.
Slots;
Tabs - place your
Tabs | Tab
components hereTab Content - place your
Tabs | Content
components here
Tabs | Tab
Component
Tabs | Tab
Component Properties;
Title - the displayed title text for the tab
Tab Identifier - a unique string to identfy the tab
Tabs | Content
Component
Tabs | Content
Component Properties;
Tab Identifier - a unique string to identfy the tab pane
Slots;
Content - place any content components you design here
Technical Notes
JavaScript is used for initialization;
to identify the initial tab
to select the initial tab and content
to clean any collection lists used for CMS-driven tabs
Native component is embedded inside, in a visibility: hidden approach. This ensures the correct CSS and JS will be published by the designer, even though the element HTML itself is not.
Reference HTML
Before Webflow.js runs, this is a simple default tabs setup. We recreate this using our component approach.
<div
data-current="Tab 1"
data-easing="ease"
data-duration-in="300"
data-duration-out="100"
class="w-tabs"
>
<div class="w-tab-menu">
<a
data-w-tab="Tab 1"
class="w-inline-block w-tab-link w--current"
>
<div>Tab 1</div>
</a>
<a
data-w-tab="Tab 2"
class="w-inline-block w-tab-link"
>
<div>Tab 2</div>
</a>
<a
data-w-tab="Tab 3"
class="w-inline-block w-tab-link"
>
<div>Tab 3</div>
</a>
</div>
<div class="w-tab-content">
<div
data-w-tab="Tab 1"
class="w-tab-pane w--tab-active"
></div>
<div
data-w-tab="Tab 2"
class="w-tab-pane"
></div>
<div
data-w-tab="Tab 3"
class="w-tab-pane"
></div>
</div>
</div>
Last updated