xxxxxxxxxx
1
<div class="container my-4">
2
<p>
3
<strong>Pills are quasi-navigation components which can highly improve website clarity and increase user experience:</strong>
4
</p>
5
6
<p>
7
Detailed documentation and more examples you can find in our
8
<a
9
href="https://mdbootstrap.com/docs/standard/navigation/pills/"
10
target="_blank"
11
><strong>Bootstrap Pills Docs</strong></a
12
>
13
</p>
14
15
<hr />
16
17
<p class="font-weight-bold">Basic example</p>
18
19
<p>
20
Basic pills are divided into 2 main sections -
21
<strong>Pills navs</strong> (containing <code>nav-item</code>s) and
22
<strong>Pills content</strong> (containing <code>tab-pane</code>s).
23
</p>
24
25
<!-- Copy this code to have a working example -->
26
<section class="border p-4 mb-4">
27
<!-- Pills navs -->
28
<ul class="nav nav-pills mb-3" id="ex1" role="tablist">
29
<li class="nav-item" role="presentation">
30
<a class="nav-link active" id="ex1-tab-1" data-mdb-toggle="pill" href="#ex1-pills-1" role="tab" aria-controls="ex1-pills-1" aria-selected="true">Tab 1</a>
31
</li>
32
<li class="nav-item" role="presentation">
33
<a class="nav-link" id="ex1-tab-2" data-mdb-toggle="pill" href="#ex1-pills-2" role="tab" aria-controls="ex1-pills-2" aria-selected="false">Tab 2</a>
34
</li>
35
<li class="nav-item" role="presentation">
36
<a class="nav-link" id="ex1-tab-3" data-mdb-toggle="pill" href="#ex1-pills-3" role="tab" aria-controls="ex1-pills-3" aria-selected="false">Tab 3</a>
37
</li>
38
</ul>
39
<!-- Pills navs -->
40
41
<!-- Pills content -->
42
<div class="tab-content" id="ex1-content">
43
<div class="tab-pane fade show active" id="ex1-pills-1" role="tabpanel" aria-labelledby="ex1-tab-1">
44
Tab 1 content
45
</div>
46
<div class="tab-pane fade" id="ex1-pills-2" role="tabpanel" aria-labelledby="ex1-tab-2">
47
Tab 2 content
48
</div>
49
<div class="tab-pane fade" id="ex1-pills-3" role="tabpanel" aria-labelledby="ex1-tab-3">
50
Tab 3 content
51
</div>
52
</div>
53
<!-- Pills content -->
54
</section>
55
<!--/ Copy this code to have a working example -->
56
57
<p class="note note-warning my-3">
58
<strong>Note:</strong> To see more examples and sourcecodes check
59
<a href="https://mdbootstrap.com/docs/standard/navigation/pills/" target="_blank" >
60
<strong>Bootstrap Pills Docs</strong>
61
</a>
62
</p>
63
64
<p class="font-weight-bold mt-3">Fill example</p>
65
66
<p>
67
To proportionately fill all available space with your <code>.nav-item</code>s, use
68
<code>.nav-fill</code>. Notice that all horizontal space is occupied, but not every nav item
69
has the same width.
70
</p>
71
72
<section class="border p-4 mb-4">
73
<!-- Pills navs -->
74
<ul class="nav nav-pills nav-fill mb-3" id="ex1" role="tablist">
75
<li class="nav-item" role="presentation">
76
<a class="nav-link active" id="ex2-tab-1" data-mdb-toggle="pill" href="#ex2-pills-1" role="tab" aria-controls="ex2-pills-1" aria-selected="true">Link</a>
77
</li>
78
<li class="nav-item" role="presentation">
79
<a class="nav-link" id="ex2-tab-2" data-mdb-toggle="pill" href="#ex2-pills-2" role="tab" aria-controls="ex2-pills-2" aria-selected="false">Very very very very long link</a>
80
</li>
81
<li class="nav-item" role="presentation">
82
<a class="nav-link" id="ex2-tab-3" data-mdb-toggle="pill" href="#ex2-pills-3" role="tab" aria-controls="ex2-pills-3" aria-selected="false">Another link</a>
83
</li>
84
</ul>
85
<!-- Pills navs -->
86
87
<!-- Pills content -->
88
<div class="tab-content" id="ex2-content">
89
<div class="tab-pane fade show active" id="ex2-pills-1" role="tabpanel" aria-labelledby="ex2-tab-1">
90
Tab 1 content
91
</div>
92
<div class="tab-pane fade" id="ex2-pills-2" role="tabpanel" aria-labelledby="ex2-tab-2">
93
Tab 2 content
94
</div>
95
<div class="tab-pane fade" id="ex2-pills-3" role="tabpanel" aria-labelledby="ex2-tab-3">
96
Tab 3 content
97
</div>
98
</div>
99
<!-- Pills content -->
100
</section>
101
102
103
<p class="font-weight-bold mt-3">Vertical example</p>
104
105
<p>
106
Stack your navigation by changing the flex item direction with the
107
<code>.flex-column</code> utility. Need to stack them on some viewports but not others? Use
108
the responsive versions (e.g., <code>.flex-sm-column</code>).
109
</p>
110
111
<section class="border p-4 mb-4">
112
<div class="row">
113
<div class="col-3">
114
<!-- Tab navs -->
115
<div class="nav flex-column nav-pills text-center" id="v-pills-tab" role="tablist" aria-orientation="vertical">
116
<a class="nav-link active" id="v-pills-home-tab" data-mdb-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true">Home</a>
117
<a class="nav-link" id="v-pills-profile-tab" data-mdb-toggle="pill" href="#v-pills-profile" role="tab" aria-controls="v-pills-profile" aria-selected="false">Profile</a>
118
<a class="nav-link" id="v-pills-messages-tab" data-mdb-toggle="pill" href="#v-pills-messages" role="tab" aria-controls="v-pills-messages" aria-selected="false">Messages</a>
119
</div>
120
<!-- Tab navs -->
121
</div>
122
123
<div class="col-9">
124
<!-- Tab content -->
125
<div class="tab-content" id="v-pills-tabContent">
126
<div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">
127
Home content
128
</div>
129
<div class="tab-pane fade" id="v-pills-profile" role="tabpanel" aria-labelledby="v-pills-profile-tab">
130
Profile content
131
</div>
132
<div class="tab-pane fade" id="v-pills-messages" role="tabpanel" aria-labelledby="v-pills-messages-tab">
133
Messages content
134
</div>
135
</div>
136
<!-- Tab content -->
137
</div>
138
</div>
139
</section>
140
141
142
</div>
1
1
1
1
Console errors: 0