Introduction

The tabs structure consists of an unordered list of tabs that have hashes corresponding to tab ids. Then when you click on each tab, only the container with the corresponding tab id will become visible. You can add the class .disabled to make a tab inaccessible.

jQuery Plugin Initialization

Tabs are initialized automatically, but if you add tabs dynamically you will have to initialize them like this.

$(document).ready(function(){
$('ul.tabs').tabs();
});

jQuery Plugin Methods

You can programmatically trigger a tab change with our select_tab method. You have to input the id of the tab you want to switch to. In the case of our demo it would be either test1, test2, test3, or test4.

Linking to an External Page

By default, Materialize tabs will ignore their default anchor behaviour. To force a tab to behave as a regular hyperlink, just specify the target property of that link! A list of target values may be found here.

Swipeable Tabs

By setting the swipeable option to true, you can enable tabs where you can swipe on touch enabled devices to switch tabs. Make sure you keep the tab content divs in the same wrapping container. You can also set the responsiveThreshold option to a screen width in pixels where the swipeable functionality will activate.

Note: This is also touch compatible! Try swiping with your finger to scroll through the carousel.

Help Materialize Grow

We hope you have enjoyed using Materialize and if you feel like it has helped you out and want to support the team you can help us by donating or backing us on Patreon. Any amount would help support and continue development on this project and is greatly appreciated.