Add tab functionality to transition through panes of local content.
- Add a
.tabs
class to a<ul>
of links for the styling. - Add the functionality with a data attribute of
data-toggle-tabs
. - Add
.tab-pane
classes to each section of content. - Point the links within the tabs to the tab panes by using either
href
or Bootstrap-styledata-target
. - Add
.is-active
to the tab and corresponding tab pane you'd like to show first.
<ul class="tabs" data-toggle-tabs>
<li><a href="#pane-1" class="is-active">Tab 1</a></li>
<li><a href="#pane-2">Tab 2</a></li>
...
</ul>
<div id="pane-1" class="is-active">Tab 1 Content</div>
<div id="pane-2">Tab 2 Content</div>
...
Box Tabs
Create tabs attached to a box by using a .box-tabs
class.
Note: This also requires a .tabbed-box
class on the sibling .box
to remove the rounded edges.
<ul class="tabs box-tabs" data-toggle-tabs>
<li><a href="#pane-1" class="is-active">Tab 1</a></li>
<li><a href="#pane-2">Tab 2</a></li>
...
</ul>
<div class="box tabbed-box">
<div id="pane-1" class="tab-pane is-active">Tab 1 Content</div>
<div id="pane-2" class="tab-pane">Tab 2 Content</div>
...
</div>