@synqro/tab-cycler
v1.2.0
Published
Create an automatic rotating tab experience in Webflow.
Maintainers
Readme
@synqro/tab-cycler
Create an automatic rotating tab experience in Webflow (or any site) with customizable timing, optional disabling of clicks, and external link support.
Installation
Add the following script to your Webflow project:
<!-- [Synqro Labs] Tab Cycler --> <script src="https://cdn.jsdelivr.net/npm/@synqro/tab-cycler@1/dist/index.min.js"></script>Create your tab structure in Webflow:
<div class="w-tabs" sl-tab-list> <a class="w-tab-link w--current" data-w-tab="Tab 1">Tab 1</a> <a class="w-tab-link" data-w-tab="Tab 2" sl-tab-click="none" >Tab 2 (disable)</a > <a class="w-tab-link" data-w-tab="Tab 3">Tab 3</a> </div>Add or adjust these custom attributes to control behavior:
| Attribute | Value | Description | | -------------- | ------------------------- | ---------------------------------------------------------- | | sl-tab-list | | Activate the tab cycler | | sl-tab-timer |
5(seconds) | Time between tab change (default: 5 seconds) | | sl-tab-click |noneorhttp(s)://...| On a tab: disable clicks or link to URL. On any other element inside the tabs: turn it into a link. | | sl-tab-target |blankorself| Open external link in new tab or same tab | | sl-tab-loading | | Animate 0% to 100% loading bar |Publish your Webflow project
Links inside a tab
sl-tab-click with a URL isn't limited to the tab headers — you can put it on any element inside the tabs container (a button, a link, a card…). That element becomes clickable and opens the URL, while the tabs keep auto-cycling.
<div class="w-tabs" sl-tab-list sl-tab-timer="5">
<div class="w-tab-menu">
<a class="w-tab-link w--current" data-w-tab="Tab 1">Tab 1</a>
<a class="w-tab-link" data-w-tab="Tab 2">Tab 2</a>
</div>
<div class="w-tab-content">
<div class="w-tab-pane w--tab-active" data-w-tab="Tab 1">
<p>Some content…</p>
<!-- CTA button inside the tab pane -->
<a class="button" sl-tab-click="https://synqro.co" sl-tab-target="blank">
Learn more
</a>
</div>
</div>
</div>