Material Design Lite – Tabs
Material Design Lite – Tabs : Material Design lite Tab is basically used to create a user interface which contains the multiple views in the same space. All The views are displayed in the same space exclusively. Material Design lite provides predefined classes to create beautiful tabs. Here in this tutorial we are going to explain how you can create tabs in material design lite and customize them. We will go step by step to explain each examples with example and demo.
Material Design Lite – Tabs Example
Here is an example of tab. First we have added width class “mdl-tabs mdl-js-tabs” main div which contains the tab elements and class “mdl-js-ripple-effect” is added to add the ripple effect.
Tabs have two parts – header & panel. Header contains the header elements. Header elements are added using the class “mdl-tabs__tab” and class “is-active” is used to represent the default tab selected. The header element’s href contains the id of panel which you want to display on button click.
Panel class “mdl-tabs__panel” is used to create the panel content you can add the class “is-active” to show the default tab panel.
Material Design Lite – Tabs : Example
If you run the above example it will produce the output like this –
Material Design Lite – Tabs Classes
Here are the inbuilt classes for material design lite tabs-
- mdl-layout : This class is used to define the div container as MDL Component.
- md-tabs : This class is used to define the tab container.
- mdl-js-tabs : This class is used to add MDL Behaviour in tabs.
- mdl-tabs__tab-bar: This class is used to create the tab header which contains the links.
- mdl-js-ripple-effect: This class is used to add the ripple effect in the tab headings
- mdl-tabs__tab: This identifies the link as MDL tab link.
- mdl-tabs__panel: This class is used to create contains for tab content.
- is-active: This class is used to represent the active tab.
More About Material Design Lite – Tabs
Let us learn more about Material Design Lite Tabs.