kmaterialize 2.0.0 → 2.3.3-1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +55 -91
- package/components/appbar/_navbar.old.scss +223 -0
- package/components/appbar/appbar.css +235 -0
- package/components/appbar/appbar.mjs +54 -0
- package/components/appbar/appbar.test.mjs +9 -0
- package/components/atomic/atomic.mjs +19 -0
- package/components/atomic/component.mjs +67 -0
- package/components/badge/_badges.scss +75 -0
- package/components/badge/badge.mjs +11 -0
- package/components/breadcrumb/_breadcrumb.scss +27 -0
- package/components/button/_buttons.scss +352 -0
- package/components/button/button.mjs +11 -0
- package/components/button/buttons.stories.ts +150 -0
- package/components/button/buttons.ts +282 -0
- package/components/button/examples.iso.js +18 -0
- package/components/button/fabSpec.js +65 -0
- package/components/button/test-button.mjs +16 -0
- package/components/card/_cards.scss +229 -0
- package/components/card/card.mjs +10 -0
- package/components/card/cards.ts +185 -0
- package/components/card/cardsSpec.js +269 -0
- package/components/carousel/_carousel.scss +93 -0
- package/components/carousel/_slider.scss +119 -0
- package/components/carousel/carousel.ts +693 -0
- package/components/carousel/carouselSpec.js +61 -0
- package/components/carousel/slider.ts +431 -0
- package/components/carousel/sliderSpec.js +99 -0
- package/components/checkbox/_checkboxes.scss +281 -0
- package/components/checkbox/checkbox.mdx +24 -0
- package/components/checkbox/checkbox.stories.ts +120 -0
- package/components/chip/chip.mjs +37 -0
- package/components/chip/chip.test.mjs +10 -0
- package/components/chip/chips.css +126 -0
- package/components/chip/chips.mdx +33 -0
- package/components/chip/chips.ts +440 -0
- package/components/chip/chipsSpec.js +165 -0
- package/components/chip/readme.md +323 -0
- package/components/collapsible/_collapsible.scss +82 -0
- package/components/collapsible/collapsible.ts +230 -0
- package/components/collapsible/collapsibleSpec.js +240 -0
- package/components/datepicker/_datepicker.scss +268 -0
- package/components/datepicker/datepicker.ts +1450 -0
- package/components/datepicker/datepickerSpec.js +162 -0
- package/components/dialog/_materialbox.scss +42 -0
- package/components/dialog/_modal.scss +79 -0
- package/components/dialog/materialbox.ts +446 -0
- package/components/dialog/materialboxSpec.js +37 -0
- package/components/dialog/modal.ts +111 -0
- package/components/dialog/modalSpec.js +83 -0
- package/components/dialog/readme.md +5 -0
- package/components/divider/readme.md +15 -0
- package/components/dropdown/_dropdown.scss +83 -0
- package/components/dropdown/dropdown.ts +653 -0
- package/components/dropdown/dropdownSpec.js +108 -0
- package/components/list/_collection.scss +114 -0
- package/components/list/_list.scss +6 -0
- package/components/list/list.mjs +58 -0
- package/components/list/list.test.mjs +16 -0
- package/components/loading/loading.mjs +26 -0
- package/components/loading/loading.test.mjs +10 -0
- package/components/navigation-bar/_old +582 -0
- package/components/navigation-bar/navigation-bar.mdx +20 -0
- package/components/navigation-bar/navigation-bar.stories.ts +39 -0
- package/components/navigation-drawer/_sidenav.scss +247 -0
- package/components/navigation-drawer/sidenav.ts +546 -0
- package/components/navigation-drawer/sidenavSpec.js +124 -0
- package/components/pagination/_pagination.scss +47 -0
- package/components/progress/_preloader.scss +416 -0
- package/components/radio-button/_radio-buttons.scss +112 -0
- package/components/radio-button/radio-buttons.mdx +28 -0
- package/components/radio-button/radio-buttons.stories.ts +51 -0
- package/components/search/autocomplete.ts +620 -0
- package/components/search/autocompleteSpec.js +321 -0
- package/components/slider/_range.scss +157 -0
- package/components/slider/range.ts +216 -0
- package/components/snackbar/_toast.scss +68 -0
- package/components/snackbar/toastSpec.js +132 -0
- package/components/snackbar/toasts.ts +312 -0
- package/components/switch/_switches.scss +121 -0
- package/components/tabs/_tabs.scss +171 -0
- package/components/tabs/tabs.mjs +31 -0
- package/components/tabs/tabs.ts +358 -0
- package/components/tabs/tabsSpec.js +180 -0
- package/components/textfield/_file-input.scss +41 -0
- package/components/textfield/_input-fields.scss +368 -0
- package/components/textfield/_select.scss +104 -0
- package/components/textfield/formfields.css +311 -0
- package/components/textfield/forms.ts +182 -0
- package/components/textfield/formsSpec.js +142 -0
- package/components/textfield/select.ts +472 -0
- package/components/textfield/selectSpec.js +390 -0
- package/components/textfield/textfield.mjs +29 -0
- package/components/textfield/textfield.test.mjs +10 -0
- package/components/timepicker/_timepicker.scss +362 -0
- package/components/timepicker/timepicker.ts +905 -0
- package/components/tooltip/_tooltip.scss +40 -0
- package/components/tooltip/tooltip.ts +380 -0
- package/components/tooltip/tooltipSpec.js +145 -0
- package/dist/css/materialize.colors.min.css +6 -0
- package/dist/css/materialize.css +7578 -6326
- package/dist/css/materialize.min.css +6 -13
- package/dist/css/materialize.min.css.map +1 -0
- package/dist/js/materialize.cjs.js +8410 -0
- package/dist/js/materialize.d.ts +2625 -0
- package/dist/js/materialize.js +8415 -12374
- package/dist/js/materialize.min.js +6 -6
- package/dist/js/materialize.mjs +8382 -0
- package/package.json +82 -47
- package/sass/_colors.scss +417 -0
- package/sass/_global.scss +490 -0
- package/sass/_grid.scss +172 -0
- package/sass/_table_of_contents.scss +28 -0
- package/sass/_tapTarget.scss +102 -0
- package/sass/_typography.scss +58 -0
- package/sass/_variables.scss +56 -0
- package/sass/materialize.scss +51 -0
- package/sass/mixins.module.scss +168 -0
- package/extras/noUiSlider/nouislider.css +0 -406
- package/extras/noUiSlider/nouislider.js +0 -2147
- package/extras/noUiSlider/nouislider.min.js +0 -1
- package/js/anime.min.js +0 -34
- package/js/autocomplete.js +0 -448
- package/js/buttons.js +0 -354
- package/js/cards.js +0 -40
- package/js/carousel.js +0 -717
- package/js/cash.js +0 -960
- package/js/characterCounter.js +0 -136
- package/js/chips.js +0 -481
- package/js/collapsible.js +0 -275
- package/js/component.js +0 -44
- package/js/datepicker.js +0 -975
- package/js/dropdown.js +0 -635
- package/js/forms.js +0 -275
- package/js/global.js +0 -444
- package/js/materialbox.js +0 -453
- package/js/modal.js +0 -382
- package/js/parallax.js +0 -138
- package/js/pushpin.js +0 -148
- package/js/range.js +0 -263
- package/js/scrollspy.js +0 -295
- package/js/select.js +0 -450
- package/js/sidenav.js +0 -580
- package/js/slider.js +0 -359
- package/js/tabs.js +0 -402
- package/js/tapTarget.js +0 -314
- package/js/timepicker.js +0 -647
- package/js/toasts.js +0 -310
- package/js/tooltip.js +0 -303
- package/js/waves.js +0 -335
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<div id="center" class="section scrollspy">
|
|
4
|
+
<h3 class="header">Centering the logo</h3>
|
|
5
|
+
<p>
|
|
6
|
+
The logo will center itself on medium and down screens, but if you want the logo to always be centered, add the <code class="language-html">center</code> class to
|
|
7
|
+
your
|
|
8
|
+
<code class="language-html">
|
|
9
|
+
<a class="brand-logo"></a>
|
|
10
|
+
</code>. You will have to make sure yourself that links do not overlap if you use this.
|
|
11
|
+
</p>
|
|
12
|
+
<nav clas="nav navbar">
|
|
13
|
+
<div class="nav-wrapper">
|
|
14
|
+
<a href="#!" class="brand-logo center">Logo</a>
|
|
15
|
+
<ul class="left hide-on-med-and-down">
|
|
16
|
+
<li>
|
|
17
|
+
<a href="sass.html">Sass</a>
|
|
18
|
+
</li>
|
|
19
|
+
<li>
|
|
20
|
+
<a href="badges.html">Components</a>
|
|
21
|
+
</li>
|
|
22
|
+
</ul>
|
|
23
|
+
</div>
|
|
24
|
+
</nav>
|
|
25
|
+
|
|
26
|
+
<pre><code class="language-html">
|
|
27
|
+
<xmp>
|
|
28
|
+
<nav class="nav navbar">
|
|
29
|
+
<div class="nav-wrapper">
|
|
30
|
+
<a href="#" class="brand-logo center">Logo</a>
|
|
31
|
+
<ul id="nav-mobile" class="left hide-on-med-and-down">
|
|
32
|
+
<li><a href="sass.html">Sass</a></li>
|
|
33
|
+
<li><a href="badges.html">Components</a></li>
|
|
34
|
+
<li><a href="collapsible.html">JavaScript</a></li>
|
|
35
|
+
</ul>
|
|
36
|
+
</div>
|
|
37
|
+
</nav>
|
|
38
|
+
</xmp>
|
|
39
|
+
</code></pre>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div id="active-label" class="section scrollspy">
|
|
43
|
+
<h3 class="header">Active Items</h3>
|
|
44
|
+
<p>Add active class to your li tags to denote the current page.</p>
|
|
45
|
+
|
|
46
|
+
<nav class="nav navbar">
|
|
47
|
+
<div class="nav-wrapper">
|
|
48
|
+
<a href="#!" class="brand-logo center">Logo</a>
|
|
49
|
+
<ul class="left hide-on-med-and-down">
|
|
50
|
+
<li>
|
|
51
|
+
<a href="sass.html">Sass</a>
|
|
52
|
+
</li>
|
|
53
|
+
<li>
|
|
54
|
+
<a href="badges.html">Components</a>
|
|
55
|
+
</li>
|
|
56
|
+
<li class="active">
|
|
57
|
+
<a href="collapsible.html">JavaScript</a>
|
|
58
|
+
</li>
|
|
59
|
+
</ul>
|
|
60
|
+
</div>
|
|
61
|
+
</nav>
|
|
62
|
+
|
|
63
|
+
<pre><code class="language-html">
|
|
64
|
+
<xmp>
|
|
65
|
+
<nav class="nav navbar">
|
|
66
|
+
<div class="nav-wrapper">
|
|
67
|
+
<a href="#!" class="brand-logo center">Logo</a>
|
|
68
|
+
<ul class="left hide-on-med-and-down">
|
|
69
|
+
<li><a href="sass.html">Sass</a></li>
|
|
70
|
+
<li><a href="badges.html">Components</a></li>
|
|
71
|
+
<li class="active"><a href="collapsible.html">JavaScript</a></li>
|
|
72
|
+
</ul>
|
|
73
|
+
</div>
|
|
74
|
+
</nav>
|
|
75
|
+
</xmp>
|
|
76
|
+
</code></pre>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<div id="navbar-tabs" class="section scrollspy">
|
|
80
|
+
<h3 class="header">Extended Navbar with Tabs</h3>
|
|
81
|
+
<p>
|
|
82
|
+
To add extended components to the navbar, add the class
|
|
83
|
+
<code class="language-html">nav-extended</code> to the outer <span class="language-html">nav</span> tag. This will allow your navbar height to be variable. Then you
|
|
84
|
+
can just include a tabs component inside the <span class="language-html">nav-wrapper</span>.
|
|
85
|
+
</p>
|
|
86
|
+
|
|
87
|
+
<nav class="nav navbar nav-extended">
|
|
88
|
+
<div class="nav-wrapper">
|
|
89
|
+
<a href="#" class="brand-logo">Logo</a>
|
|
90
|
+
<a href="#" data-target="mobile-demo" class="sidenav-trigger">
|
|
91
|
+
<i class="material-icons">menu</i>
|
|
92
|
+
</a>
|
|
93
|
+
<ul id="nav-mobile" class="right hide-on-med-and-down">
|
|
94
|
+
<li>
|
|
95
|
+
<a href="sass.html">Sass</a>
|
|
96
|
+
</li>
|
|
97
|
+
<li>
|
|
98
|
+
<a href="badges.html">Components</a>
|
|
99
|
+
</li>
|
|
100
|
+
<li>
|
|
101
|
+
<a href="collapsible.html">JavaScript</a>
|
|
102
|
+
</li>
|
|
103
|
+
</ul>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="nav-content">
|
|
106
|
+
<ul class="tabs tabs-transparent">
|
|
107
|
+
<li class="tab">
|
|
108
|
+
<a href="#test1">Test 1</a>
|
|
109
|
+
</li>
|
|
110
|
+
<li class="tab">
|
|
111
|
+
<a class="active" href="#test2">Test 2</a>
|
|
112
|
+
</li>
|
|
113
|
+
<li class="tab disabled">
|
|
114
|
+
<a href="#test3">Disabled Tab</a>
|
|
115
|
+
</li>
|
|
116
|
+
<li class="tab">
|
|
117
|
+
<a href="#test4">Test 4</a>
|
|
118
|
+
</li>
|
|
119
|
+
</ul>
|
|
120
|
+
</div>
|
|
121
|
+
</nav>
|
|
122
|
+
|
|
123
|
+
<ul class="sidenav" id="mobile-demo">
|
|
124
|
+
<li>
|
|
125
|
+
<a href="sass.html">Sass</a>
|
|
126
|
+
</li>
|
|
127
|
+
<li>
|
|
128
|
+
<a href="badges.html">Components</a>
|
|
129
|
+
</li>
|
|
130
|
+
<li>
|
|
131
|
+
<a href="collapsible.html">JavaScript</a>
|
|
132
|
+
</li>
|
|
133
|
+
</ul>
|
|
134
|
+
|
|
135
|
+
<div id="test1" class="col s12">Test 1</div>
|
|
136
|
+
<div id="test2" class="col s12">Test 2</div>
|
|
137
|
+
<div id="test3" class="col s12">Test 3</div>
|
|
138
|
+
<div id="test4" class="col s12">Test 4</div>
|
|
139
|
+
|
|
140
|
+
<pre><code class="language-html">
|
|
141
|
+
<xmp>
|
|
142
|
+
<nav class="nav navbar nav-extended">
|
|
143
|
+
<div class="nav-wrapper">
|
|
144
|
+
<a href="#" class="brand-logo">Logo</a>
|
|
145
|
+
<a href="#" data-target="mobile-demo" class="sidenav-trigger"><i class="material-icons">menu</i></a>
|
|
146
|
+
<ul id="nav-mobile" class="right hide-on-med-and-down">
|
|
147
|
+
<li><a href="sass.html">Sass</a></li>
|
|
148
|
+
<li><a href="badges.html">Components</a></li>
|
|
149
|
+
<li><a href="collapsible.html">JavaScript</a></li>
|
|
150
|
+
</ul>
|
|
151
|
+
</div>
|
|
152
|
+
<div class="nav-content">
|
|
153
|
+
<ul class="tabs tabs-transparent">
|
|
154
|
+
<li class="tab"><a href="#test1">Test 1</a></li>
|
|
155
|
+
<li class="tab"><a class="active" href="#test2">Test 2</a></li>
|
|
156
|
+
<li class="tab disabled"><a href="#test3">Disabled Tab</a></li>
|
|
157
|
+
<li class="tab"><a href="#test4">Test 4</a></li>
|
|
158
|
+
</ul>
|
|
159
|
+
</div>
|
|
160
|
+
</nav>
|
|
161
|
+
|
|
162
|
+
<ul class="sidenav" id="mobile-demo">
|
|
163
|
+
<li><a href="sass.html">Sass</a></li>
|
|
164
|
+
<li><a href="badges.html">Components</a></li>
|
|
165
|
+
<li><a href="collapsible.html">JavaScript</a></li>
|
|
166
|
+
</ul>
|
|
167
|
+
|
|
168
|
+
<div id="test1" class="col s12">Test 1</div>
|
|
169
|
+
<div id="test2" class="col s12">Test 2</div>
|
|
170
|
+
<div id="test3" class="col s12">Test 3</div>
|
|
171
|
+
<div id="test4" class="col s12">Test 4</div>
|
|
172
|
+
</xmp>
|
|
173
|
+
</code></pre>
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<div id="navbar-fixed" class="section scrollspy">
|
|
177
|
+
<h3 class="header">Fixed Navbar</h3>
|
|
178
|
+
<p>
|
|
179
|
+
To make the navbar fixed, you have to add an outer wrapping div with the class
|
|
180
|
+
<code class="language-html">navbar-fixed</code>. This will offset your other content while making your nav fixed. You can adjust the height of this outer div to
|
|
181
|
+
change how much offset is on your content.
|
|
182
|
+
</p>
|
|
183
|
+
|
|
184
|
+
<pre><code class="language-html">
|
|
185
|
+
<xmp>
|
|
186
|
+
<div class="navbar-fixed">
|
|
187
|
+
<nav class="nav navbar">
|
|
188
|
+
<div class="nav-wrapper">
|
|
189
|
+
<a href="#!" class="brand-logo">Logo</a>
|
|
190
|
+
<ul class="right hide-on-med-and-down">
|
|
191
|
+
<li><a href="sass.html">Sass</a></li>
|
|
192
|
+
<li><a href="badges.html">Components</a></li>
|
|
193
|
+
</ul>
|
|
194
|
+
</div>
|
|
195
|
+
</nav>
|
|
196
|
+
</div>
|
|
197
|
+
</xmp>
|
|
198
|
+
</code></pre>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<div id="navbar-dropdown" class="section scrollspy">
|
|
202
|
+
<h3 class="header">Navbar Dropdown Menu</h3>
|
|
203
|
+
<p>
|
|
204
|
+
To add a navbar dropdown menu, add the
|
|
205
|
+
<code class="language-html">ul</code> dropdown structure into the page. Then, add an element to trigger the dropdown menu. Make sure to supply the id of the
|
|
206
|
+
dropdown structure to the <code class="language-html">data-target</code> attribute of the dropdown trigger.
|
|
207
|
+
</p>
|
|
208
|
+
|
|
209
|
+
<!-- Dropdown Structure -->
|
|
210
|
+
<ul id="dropdown1" class="dropdown-content">
|
|
211
|
+
<li>
|
|
212
|
+
<a href="#!">one</a>
|
|
213
|
+
</li>
|
|
214
|
+
<li>
|
|
215
|
+
<a href="#!">two</a>
|
|
216
|
+
</li>
|
|
217
|
+
<li class="divider"></li>
|
|
218
|
+
<li>
|
|
219
|
+
<a href="#!">three</a>
|
|
220
|
+
</li>
|
|
221
|
+
</ul>
|
|
222
|
+
<nav class="nav navbar">
|
|
223
|
+
<div class="nav-wrapper">
|
|
224
|
+
<a href="#!" class="brand-logo">Logo</a>
|
|
225
|
+
<ul class="right hide-on-med-and-down">
|
|
226
|
+
<li>
|
|
227
|
+
<a href="sass.html">Sass</a>
|
|
228
|
+
</li>
|
|
229
|
+
<li>
|
|
230
|
+
<a href="badges.html">Components</a>
|
|
231
|
+
</li>
|
|
232
|
+
<!-- Dropdown Trigger -->
|
|
233
|
+
<li>
|
|
234
|
+
<a class="dropdown-trigger" href="#!" data-target="dropdown1"
|
|
235
|
+
>Dropdown
|
|
236
|
+
<i class="material-icons right">arrow_drop_down</i>
|
|
237
|
+
</a>
|
|
238
|
+
</li>
|
|
239
|
+
</ul>
|
|
240
|
+
</div>
|
|
241
|
+
</nav>
|
|
242
|
+
|
|
243
|
+
<pre><code class="language-html">
|
|
244
|
+
<xmp>
|
|
245
|
+
<!-- Dropdown Structure -->
|
|
246
|
+
<ul id="dropdown1" class="dropdown-content">
|
|
247
|
+
<li><a href="#!">one</a></li>
|
|
248
|
+
<li><a href="#!">two</a></li>
|
|
249
|
+
<li class="divider"></li>
|
|
250
|
+
<li><a href="#!">three</a></li>
|
|
251
|
+
</ul>
|
|
252
|
+
<nav class="nav navbar">
|
|
253
|
+
<div class="nav-wrapper">
|
|
254
|
+
<a href="#!" class="brand-logo">Logo</a>
|
|
255
|
+
<ul class="right hide-on-med-and-down">
|
|
256
|
+
<li><a href="sass.html">Sass</a></li>
|
|
257
|
+
<li><a href="badges.html">Components</a></li>
|
|
258
|
+
<!-- Dropdown Trigger -->
|
|
259
|
+
<li><a class="dropdown-trigger" href="#!" data-target="dropdown1">Dropdown<i class="material-icons right">arrow_drop_down</i></a></li>
|
|
260
|
+
</ul>
|
|
261
|
+
</div>
|
|
262
|
+
</nav>
|
|
263
|
+
</xmp>
|
|
264
|
+
</code></pre>
|
|
265
|
+
<p>
|
|
266
|
+
To activate the dropdown menu, insert this line of code into your JavaScript file. You can read more about the
|
|
267
|
+
<a href="dropdown.html" target="_blank">Dropdown component here</a>.
|
|
268
|
+
</p>
|
|
269
|
+
<pre><code class="language-javascript">
|
|
270
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
271
|
+
const elems = document.querySelectorAll('.dropdown-trigger');
|
|
272
|
+
const instances = M.Dropdown.init(elems, {
|
|
273
|
+
// specify options here
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
</code></pre>
|
|
277
|
+
<h5>Trigger dropdown menu on click</h5>
|
|
278
|
+
<p>
|
|
279
|
+
By default, the dropdown menu is activated by hovering over the dropdown trigger. To activate the dropdown menu on click, pass
|
|
280
|
+
<code class="language-javascript">{ hover: false }</code> into the above <code class="language-javascript">dropdown()</code> function
|
|
281
|
+
</p>
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
<div id="icons" class="section scrollspy">
|
|
285
|
+
<h3 class="header">Icon Links</h3>
|
|
286
|
+
|
|
287
|
+
<nav class="nav navbar">
|
|
288
|
+
<div class="nav-wrapper">
|
|
289
|
+
<a href="#!" class="brand-logo"> <i class="material-icons">cloud</i>Logo</a>
|
|
290
|
+
<ul class="right hide-on-med-and-down">
|
|
291
|
+
<li>
|
|
292
|
+
<a href="sass.html">
|
|
293
|
+
<i class="material-icons">search</i>
|
|
294
|
+
</a>
|
|
295
|
+
</li>
|
|
296
|
+
<li>
|
|
297
|
+
<a href="badges.html">
|
|
298
|
+
<i class="material-icons">view_module</i>
|
|
299
|
+
</a>
|
|
300
|
+
</li>
|
|
301
|
+
<li>
|
|
302
|
+
<a href="collapsible.html">
|
|
303
|
+
<i class="material-icons">refresh</i>
|
|
304
|
+
</a>
|
|
305
|
+
</li>
|
|
306
|
+
<li>
|
|
307
|
+
<a href="mobile.html">
|
|
308
|
+
<i class="material-icons">more_vert</i>
|
|
309
|
+
</a>
|
|
310
|
+
</li>
|
|
311
|
+
</ul>
|
|
312
|
+
</div>
|
|
313
|
+
</nav>
|
|
314
|
+
|
|
315
|
+
<p>
|
|
316
|
+
You can add icons into links. For icon only links you don't need any additional class. Just pop the <code class="language-html">i</code> tag in and it will work.
|
|
317
|
+
</p>
|
|
318
|
+
<pre><code class="language-html">
|
|
319
|
+
<xmp>
|
|
320
|
+
<nav class="nav navbar">
|
|
321
|
+
<div class="nav-wrapper">
|
|
322
|
+
<a href="#!" class="brand-logo"><i class="material-icons">cloud</i>Logo</a>
|
|
323
|
+
<ul class="right hide-on-med-and-down">
|
|
324
|
+
<li><a href="sass.html"><i class="material-icons">search</i></a></li>
|
|
325
|
+
<li><a href="badges.html"><i class="material-icons">view_module</i></a></li>
|
|
326
|
+
<li><a href="collapsible.html"><i class="material-icons">refresh</i></a></li>
|
|
327
|
+
<li><a href="mobile.html"><i class="material-icons">more_vert</i></a></li>
|
|
328
|
+
</ul>
|
|
329
|
+
</div>
|
|
330
|
+
</nav>
|
|
331
|
+
</xmp>
|
|
332
|
+
</code></pre>
|
|
333
|
+
|
|
334
|
+
<nav class="nav navbar">
|
|
335
|
+
<div class="nav-wrapper">
|
|
336
|
+
<a href="#!" class="brand-logo">Logo</a>
|
|
337
|
+
<ul class="right hide-on-med-and-down">
|
|
338
|
+
<li>
|
|
339
|
+
<a href="sass.html"> <i class="material-icons left">search</i>Link with Left Icon</a>
|
|
340
|
+
</li>
|
|
341
|
+
<li>
|
|
342
|
+
<a href="badges.html">
|
|
343
|
+
<i class="material-icons right">view_module</i>
|
|
344
|
+
Link with Right Icon</a
|
|
345
|
+
>
|
|
346
|
+
</li>
|
|
347
|
+
</ul>
|
|
348
|
+
</div>
|
|
349
|
+
</nav>
|
|
350
|
+
|
|
351
|
+
<p>
|
|
352
|
+
For adding an icon to a text link you need to add either a <code class="language-html">left</code> or <code class="language-html">right</code> class to the icon
|
|
353
|
+
depending on where you want the icon to be.
|
|
354
|
+
</p>
|
|
355
|
+
<pre><code class="language-html">
|
|
356
|
+
<xmp>
|
|
357
|
+
<nav class="nav navbar">
|
|
358
|
+
<div class="nav-wrapper">
|
|
359
|
+
<a href="#!" class="brand-logo">Logo</a>
|
|
360
|
+
<ul class="right hide-on-med-and-down">
|
|
361
|
+
<li><a href="sass.html"><i class="material-icons left">search</i>Link with Left Icon</a></li>
|
|
362
|
+
<li><a href="badges.html"><i class="material-icons right">view_module</i>Link with Right Icon</a></li>
|
|
363
|
+
</ul>
|
|
364
|
+
</div>
|
|
365
|
+
</nav>
|
|
366
|
+
</xmp>
|
|
367
|
+
</code></pre>
|
|
368
|
+
</div>
|
|
369
|
+
|
|
370
|
+
<div id="buttons" class="section scrollspy">
|
|
371
|
+
<h3 class="header">Buttons</h3>
|
|
372
|
+
|
|
373
|
+
<nav class="nav navbar">
|
|
374
|
+
<div class="nav-wrapper">
|
|
375
|
+
<a href="#!" class="brand-logo">Logo</a>
|
|
376
|
+
<ul class="right hide-on-med-and-down">
|
|
377
|
+
<li>
|
|
378
|
+
<a class="waves-effect waves-light btn">Button</a>
|
|
379
|
+
</li>
|
|
380
|
+
<li>
|
|
381
|
+
<a class="waves-effect waves-light btn"
|
|
382
|
+
>Button
|
|
383
|
+
<i class="material-icons right">cloud</i>
|
|
384
|
+
</a>
|
|
385
|
+
</li>
|
|
386
|
+
<li>
|
|
387
|
+
<a class="waves-effect waves-light btn-large">Large Button</a>
|
|
388
|
+
</li>
|
|
389
|
+
</ul>
|
|
390
|
+
</div>
|
|
391
|
+
</nav>
|
|
392
|
+
|
|
393
|
+
<p>
|
|
394
|
+
You can add buttons into links. For buttons you don't need any additional class. Just pop the <code class="language-html">.btn</code> class on the
|
|
395
|
+
<code class="language-html">a</code> tag.
|
|
396
|
+
</p>
|
|
397
|
+
<pre><code class="language-html">
|
|
398
|
+
<xmp>
|
|
399
|
+
<nav class="nav navbar">
|
|
400
|
+
<div class="nav-wrapper">
|
|
401
|
+
<a href="#!" class="brand-logo">Logo</a>
|
|
402
|
+
<ul class="right hide-on-med-and-down">
|
|
403
|
+
<li><a class="waves-effect waves-light btn">Button</a></li>
|
|
404
|
+
<li><a class="waves-effect waves-light btn">Button <i class="material-icons right">cloud</i></a></li>
|
|
405
|
+
<li><a class="waves-effect waves-light btn-large">Large Button</a></li>
|
|
406
|
+
</ul>
|
|
407
|
+
</div>
|
|
408
|
+
</nav>
|
|
409
|
+
</xmp>
|
|
410
|
+
</code></pre>
|
|
411
|
+
|
|
412
|
+
<h5>Halfway FAB in Extended Navbar</h5>
|
|
413
|
+
<p>Add a halfway FAB to your extended navbar.</p>
|
|
414
|
+
|
|
415
|
+
<nav class="nav navbar nav-extended">
|
|
416
|
+
<div class="nav-wrapper">
|
|
417
|
+
<a href="#!" class="brand-logo">Logo</a>
|
|
418
|
+
<ul class="right hide-on-med-and-down">
|
|
419
|
+
<li>
|
|
420
|
+
<a>A link</a>
|
|
421
|
+
</li>
|
|
422
|
+
<li>
|
|
423
|
+
<a>A second link</a>
|
|
424
|
+
</li>
|
|
425
|
+
<li>
|
|
426
|
+
<a>A third link</a>
|
|
427
|
+
</li>
|
|
428
|
+
</ul>
|
|
429
|
+
</div>
|
|
430
|
+
<div class="nav-content">
|
|
431
|
+
<span class="nav-title">Title</span>
|
|
432
|
+
<a class="btn-floating btn-large halfway-fab waves-effect waves-light">
|
|
433
|
+
<i class="material-icons">add</i>
|
|
434
|
+
</a>
|
|
435
|
+
</div>
|
|
436
|
+
</nav>
|
|
437
|
+
|
|
438
|
+
<pre><code class="language-html">
|
|
439
|
+
<xmp>
|
|
440
|
+
<nav class="nav navbar nav-extended">
|
|
441
|
+
<div class="nav-wrapper">
|
|
442
|
+
<a href="#!" class="brand-logo">Logo</a>
|
|
443
|
+
<ul class="right hide-on-med-and-down">
|
|
444
|
+
<li><a>A link</a></li>
|
|
445
|
+
<li><a>A second link</a></li>
|
|
446
|
+
<li><a>A third link</a></li>
|
|
447
|
+
</ul>
|
|
448
|
+
</div>
|
|
449
|
+
<div class="nav-content">
|
|
450
|
+
<span class="nav-title">Title</span>
|
|
451
|
+
<a class="btn-floating btn-large halfway-fab waves-effect waves-light">
|
|
452
|
+
<i class="material-icons">add</i>
|
|
453
|
+
</a>
|
|
454
|
+
</div>
|
|
455
|
+
</nav>
|
|
456
|
+
</xmp>
|
|
457
|
+
</code></pre>
|
|
458
|
+
</div>
|
|
459
|
+
|
|
460
|
+
<div id="search-docs" class="section scrollspy">
|
|
461
|
+
<h3 class="header">Search Bar</h3>
|
|
462
|
+
|
|
463
|
+
<nav class="nav navbar">
|
|
464
|
+
<div class="nav-wrapper">
|
|
465
|
+
<form>
|
|
466
|
+
<div class="input-field">
|
|
467
|
+
<input id="search-example" type="search" required />
|
|
468
|
+
<label class="label-icon" for="search-example">
|
|
469
|
+
<i class="material-icons">search</i>
|
|
470
|
+
</label>
|
|
471
|
+
<i class="material-icons">close</i>
|
|
472
|
+
</div>
|
|
473
|
+
</form>
|
|
474
|
+
</div>
|
|
475
|
+
</nav>
|
|
476
|
+
|
|
477
|
+
<p>You can add a search form in the navbar.</p>
|
|
478
|
+
<pre><code class="language-html">
|
|
479
|
+
<xmp>
|
|
480
|
+
<nav class="navbar">
|
|
481
|
+
<div class="nav-wrapper">
|
|
482
|
+
<form>
|
|
483
|
+
<div class="input-field">
|
|
484
|
+
<input id="search" type="search" required>
|
|
485
|
+
<label class="label-icon" for="search"><i class="material-icons">search</i></label>
|
|
486
|
+
<i class="material-icons">close</i>
|
|
487
|
+
</div>
|
|
488
|
+
</form>
|
|
489
|
+
</div>
|
|
490
|
+
</nav>
|
|
491
|
+
</xmp>
|
|
492
|
+
</code></pre>
|
|
493
|
+
</div>
|
|
494
|
+
|
|
495
|
+
<div id="mobile-collapse" class="section scrollspy">
|
|
496
|
+
<h3 class="header">Mobile Collapse Button</h3>
|
|
497
|
+
|
|
498
|
+
<nav class="nav navbar">
|
|
499
|
+
<div class="nav-wrapper">
|
|
500
|
+
<a href="#!" class="brand-logo">Logo</a>
|
|
501
|
+
<a href="#" data-target="mobile-demo" class="sidenav-trigger">
|
|
502
|
+
<i class="material-icons">menu</i>
|
|
503
|
+
</a>
|
|
504
|
+
<ul class="right hide-on-med-and-down">
|
|
505
|
+
<li>
|
|
506
|
+
<a href="sass.html">Sass</a>
|
|
507
|
+
</li>
|
|
508
|
+
<li>
|
|
509
|
+
<a href="badges.html">Components</a>
|
|
510
|
+
</li>
|
|
511
|
+
<li>
|
|
512
|
+
<a href="collapsible.html">Javascript</a>
|
|
513
|
+
</li>
|
|
514
|
+
<li>
|
|
515
|
+
<a href="mobile.html">Mobile</a>
|
|
516
|
+
</li>
|
|
517
|
+
<li>
|
|
518
|
+
<a class="btn waves-effect waves-light" href="buttons.html">Buttons</a>
|
|
519
|
+
</li>
|
|
520
|
+
</ul>
|
|
521
|
+
</div>
|
|
522
|
+
</nav>
|
|
523
|
+
|
|
524
|
+
<ul class="sidenav" id="mobile-demo">
|
|
525
|
+
<li>
|
|
526
|
+
<a href="sass.html">Sass</a>
|
|
527
|
+
</li>
|
|
528
|
+
<li>
|
|
529
|
+
<a href="badges.html">Components</a>
|
|
530
|
+
</li>
|
|
531
|
+
<li>
|
|
532
|
+
<a href="collapsible.html">Javascript</a>
|
|
533
|
+
</li>
|
|
534
|
+
<li>
|
|
535
|
+
<a href="mobile.html">Mobile</a>
|
|
536
|
+
</li>
|
|
537
|
+
<li>
|
|
538
|
+
<a class="btn waves-effect waves-light" href="buttons.html">Buttons</a>
|
|
539
|
+
</li>
|
|
540
|
+
</ul>
|
|
541
|
+
|
|
542
|
+
<p>
|
|
543
|
+
When your nav bar is resized, you will see that the links on the right turn into a hamburger icon <i class="material-icons">menu</i>. Take a look at the example
|
|
544
|
+
below to get this functionality. Add the entire <code class="language-html">sidenav-trigger</code> line to your <code class="language-html">nav</code>.
|
|
545
|
+
</p>
|
|
546
|
+
<pre><code class="language-html">
|
|
547
|
+
<xmp>
|
|
548
|
+
<nav class="nav navbar">
|
|
549
|
+
<div class="nav-wrapper">
|
|
550
|
+
<a href="#!" class="brand-logo">Logo</a>
|
|
551
|
+
<a href="#" data-target="mobile-demo" class="sidenav-trigger"><i class="material-icons">menu</i></a>
|
|
552
|
+
<ul class="right hide-on-med-and-down">
|
|
553
|
+
<li><a href="sass.html">Sass</a></li>
|
|
554
|
+
<li><a href="badges.html">Components</a></li>
|
|
555
|
+
<li><a href="collapsible.html">Javascript</a></li>
|
|
556
|
+
<li><a href="mobile.html">Mobile</a></li>
|
|
557
|
+
</ul>
|
|
558
|
+
</div>
|
|
559
|
+
</nav>
|
|
560
|
+
|
|
561
|
+
<ul class="sidenav" id="mobile-demo">
|
|
562
|
+
<li><a href="sass.html">Sass</a></li>
|
|
563
|
+
<li><a href="badges.html">Components</a></li>
|
|
564
|
+
<li><a href="collapsible.html">Javascript</a></li>
|
|
565
|
+
<li><a href="mobile.html">Mobile</a></li>
|
|
566
|
+
</ul>
|
|
567
|
+
</xmp>
|
|
568
|
+
</code></pre>
|
|
569
|
+
|
|
570
|
+
<h5>Initialization</h5>
|
|
571
|
+
<p>
|
|
572
|
+
After including the sidenav-trigger line into your navbar, all you have to do now initialize the plugin. This example below assumes you have not modified the
|
|
573
|
+
classes in the above example. In the case that you have, just change the selector in the line below to match it.
|
|
574
|
+
</p>
|
|
575
|
+
<pre><code class="language-javascript">
|
|
576
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
577
|
+
const elems = document.querySelectorAll('.sidenav');
|
|
578
|
+
const instances = M.Sidenav.init(elems, options);
|
|
579
|
+
});
|
|
580
|
+
</code></pre>
|
|
581
|
+
</div>
|
|
582
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {Story, Meta, Source, Controls, Markdown, Primary} from '@storybook/addon-docs/blocks';
|
|
2
|
+
import * as stories from './navigation-bar.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={stories}/>
|
|
5
|
+
|
|
6
|
+
# Navigation Bar
|
|
7
|
+
|
|
8
|
+
There are 2 main parts of the navbar. A logo or brand link, and the navigations links. You can align these links to the left or right.
|
|
9
|
+
|
|
10
|
+
## Right Aligned Links
|
|
11
|
+
|
|
12
|
+
To right align your navbar links, just add a `right` class to the `ul` that contains them.
|
|
13
|
+
|
|
14
|
+
<Story of={stories.RightAligned} />
|
|
15
|
+
<Source of={stories.RightAligned} format="dedent"/>
|
|
16
|
+
|
|
17
|
+
## Left Aligned Links
|
|
18
|
+
|
|
19
|
+
<Story of={stories.LeftAligned} />
|
|
20
|
+
<Source of={stories.LeftAligned} format="dedent"/>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/html-vite';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Navigation-Bar'
|
|
5
|
+
} satisfies Meta;
|
|
6
|
+
|
|
7
|
+
export const RightAligned: StoryObj = {
|
|
8
|
+
render() {
|
|
9
|
+
return `
|
|
10
|
+
<nav class="nav navbar">
|
|
11
|
+
<div class="nav-wrapper">
|
|
12
|
+
<a href="#" class="brand-logo">Logo</a>
|
|
13
|
+
<ul id="nav-mobile" class="right hide-on-med-and-down">
|
|
14
|
+
<li><a href="sass.html">Sass</a></li>
|
|
15
|
+
<li><a href="badges.html">Components</a></li>
|
|
16
|
+
<li><a href="collapsible.html">JavaScript</a></li>
|
|
17
|
+
</ul>
|
|
18
|
+
</div>
|
|
19
|
+
</nav>
|
|
20
|
+
`;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const LeftAligned: StoryObj = {
|
|
25
|
+
render() {
|
|
26
|
+
return `
|
|
27
|
+
<nav class="nav navbar">
|
|
28
|
+
<div class="nav-wrapper">
|
|
29
|
+
<a href="#" class="brand-logo right">Logo</a>
|
|
30
|
+
<ul id="nav-mobile" class="left hide-on-med-and-down">
|
|
31
|
+
<li><a href="sass.html">Sass</a></li>
|
|
32
|
+
<li><a href="badges.html">Components</a></li>
|
|
33
|
+
<li><a href="collapsible.html">JavaScript</a></li>
|
|
34
|
+
</ul>
|
|
35
|
+
</div>
|
|
36
|
+
</nav>
|
|
37
|
+
`;
|
|
38
|
+
}
|
|
39
|
+
};
|