forked from boiyelove/materializecss-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
navbar.html
1028 lines (966 loc) · 42.3 KB
/
navbar.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="msapplication-tap-highlight" content="no">
<meta name="description" content="Materialize is a modern responsive CSS framework based on Material Design by Google. ">
<title>Navbar - Materialize</title>
<!-- Favicons-->
<link rel="apple-touch-icon-precomposed" href="images/favicon/apple-touch-icon-152x152.png">
<meta name="msapplication-TileColor" content="#FFFFFF">
<meta name="msapplication-TileImage" content="images/favicon/mstile-144x144.png">
<link rel="icon" href="images/favicon/favicon-32x32.png" sizes="32x32">
<!-- Android 5 Chrome Color-->
<meta name="theme-color" content="#EE6E73">
<!-- CSS-->
<link href="css/prism.css" rel="stylesheet">
<link href="css/ghpages-materialize.css" type="text/css" rel="stylesheet" media="screen,projection">
<link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- if !isDemo-->
<!-- script.-->
<!-- window.liveSettings = {-->
<!-- api_key: "a0b49b34b93844c38eaee15690d86413",-->
<!-- picker: "bottom-right",-->
<!-- detectlang: true,-->
<!-- dynamic: true,-->
<!-- autocollect: true-->
<!-- };-->
<!-- script(src='//cdn.transifex.com/live.js')-->
</head>
<body>
<header>
<nav class="top-nav">
<div class="container">
<div class="nav-wrapper">
<div class="row">
<div class="col s12 m10 offset-m1">
<h1 class="header">Navbar</h1>
</div>
</div>
</div>
</div>
</nav>
<div class="container"><a href="navbar.html#" data-target="nav-mobile" class="top-nav sidenav-trigger full hide-on-large-only"><i class="material-icons">menu</i></a></div>
<ul id="nav-mobile" class="sidenav sidenav-fixed">
<li class="logo"><a id="logo-container" href="materializecss_default_2.html" class="brand-logo">
<object id="front-page-logo" type="image/svg+xml" data="res/materialize.svg">Your browser does not support SVG</object></a></li>
<li class="version"><a href="navbar.html#" data-target="version-dropdown" class="dropdown-trigger">
1.0.0-rc.2
<svg class="caret" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></a>
<ul id="version-dropdown" class="dropdown-content">
<li><a>1.0.0-rc.2</a></li>
<li><a href="0.100.2/0.100.2.html">0.100.2</a></li>
</ul>
</li>
<li class="search">
<div class="search-wrapper">
<input id="search" placeholder="Search"><i class="material-icons">search</i>
<div class="search-results"></div>
</div>
</li>
<li class="bold"><a href="about.html" class="waves-effect waves-teal">About</a></li>
<li class="bold"><a href="getting-started_2.html" class="waves-effect waves-teal">Getting Started</a></li>
<li class="no-padding">
<ul class="collapsible collapsible-accordion">
<li class="bold"><a class="collapsible-header waves-effect waves-teal">CSS</a>
<div class="collapsible-body">
<ul>
<li><a href="color.html">Color</a></li>
<li><a href="grid.html">Grid</a></li>
<li><a href="helpers.html">Helpers</a></li>
<li><a href="media-css.html">Media</a></li>
<li><a href="pulse.html">Pulse</a></li>
<li><a href="sass.html">Sass</a></li>
<li><a href="shadow.html">Shadow</a></li>
<li><a href="table.html">Table</a></li>
<li><a href="css-transitions.html">Transitions</a></li>
<li><a href="typography.html">Typography</a></li>
</ul>
</div>
</li>
<li class="bold active"><a class="collapsible-header waves-effect waves-teal">Components</a>
<div class="collapsible-body">
<ul>
<li><a href="badges.html">Badges</a></li>
<li><a href="buttons.html">Buttons</a></li>
<li><a href="breadcrumbs.html">Breadcrumbs</a></li>
<li><a href="cards.html">Cards</a></li>
<li><a href="collections.html">Collections</a></li>
<li><a href="floating-action-button.html">Floating Action Button</a></li>
<li><a href="footer.html">Footer</a></li>
<li><a href="icons.html">Icons</a></li>
<li class="active"><a href="navbar.html">Navbar</a></li>
<li><a href="pagination.html">Pagination</a></li>
<li><a href="preloader.html">Preloader</a></li>
</ul>
</div>
</li>
<li class="bold"><a class="collapsible-header waves-effect waves-teal">JavaScript</a>
<div class="collapsible-body">
<ul>
<li><a href="auto-init.html">Auto Init</a></li>
<li><a href="carousel.html">Carousel</a></li>
<li><a href="collapsible.html">Collapsible</a></li>
<li><a href="dropdown.html">Dropdown</a></li>
<li><a href="feature-discovery.html">FeatureDiscovery</a></li>
<li><a href="media.html">Media</a></li>
<li><a href="modals.html">Modals</a></li>
<li><a href="parallax.html">Parallax</a></li>
<li><a href="pushpin.html">Pushpin</a></li>
<li><a href="scrollspy.html">Scrollspy</a></li>
<li><a href="sidenav.html">Sidenav</a></li>
<li><a href="tabs.html">Tabs</a></li>
<li><a href="toasts.html">Toasts</a></li>
<li><a href="tooltips.html">Tooltips</a></li>
<li><a href="waves.html">Waves</a></li>
</ul>
</div>
</li>
<li class="bold"><a class="collapsible-header waves-effect waves-teal">Forms</a>
<div class="collapsible-body">
<ul>
<li><a href="autocomplete.html">Autocomplete</a></li>
<li><a href="checkboxes.html">Checkboxes</a></li>
<li><a href="chips.html">Chips</a></li>
<li><a href="pickers.html">Pickers</a></li>
<li><a href="radio-buttons.html">Radio Buttons</a></li>
<li><a href="range.html">Range</a></li>
<li><a href="select.html">Select</a></li>
<li><a href="switches.html">Switches</a></li>
<li><a href="text-inputs.html">Text Inputs</a></li>
</ul>
</div>
</li>
</ul>
</li>
<li class="bold"><a href="mobile.html" class="waves-effect waves-teal">Mobile</a></li>
<li class="bold"><a href="showcase_2.html" class="waves-effect waves-teal">Showcase</a></li>
<li class="bold"><a href="themes_2.html" class="waves-effect waves-teal">Themes<span class="new badge"></span></a></li>
</ul>
<!-- Sidebar BSA-->
<script src="https://m.servedby-buysellads.com/monetization.js" type="text/javascript"></script>
<div class="bsa-cpc"></div>
<script>
(function(){
if(typeof _bsa !== 'undefined' && _bsa) {
_bsa.init('default', 'CKYD55QM', 'placement:materializecsscom', {
target: '.bsa-cpc',
align: 'horizontal',
disable_css: 'true'
});
}
})();
</script>
<div class="patreon-ad"><a href="https://www.patreon.com/materialize" target="_blank" class="waves-effect">Become a Patron</a></div>
</header>
<main><div class="container">
<div class="row">
<div class="col s12 m8 offset-m1 xl7 offset-xl1">
<div id="right" class="section scrollspy">
<p class="caption">The navbar is fully contained by an HTML5 Nav tag. Inside a recommended container div, 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.
</p>
<h3 class="header">Right Aligned Links</h3>
<p>To right align your navbar links, just add a
<code class="language-markup">right</code> class to your
<code class="language-markup"><ul></code> that contains them.</p>
<nav>
<div class="nav-wrapper">
<div class="col s12">
<a href="navbar.html#!" class="brand-logo">Logo</a>
<ul class="right hide-on-med-and-down">
<li>
<a href="sass.html">Sass</a>
</li>
<li>
<a href="badges.html">Components</a>
</li>
<li>
<a href="collapsible.html">JavaScript</a>
</li>
</ul>
</div>
</div>
</nav>
<br>
<pre><code class="language-markup">
<nav>
<div class="nav-wrapper">
<a href="#" class="brand-logo">Logo</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
<li><a href="collapsible.html">JavaScript</a></li>
</ul>
</div>
</nav>
</code></pre>
</div>
<div id="left" class="section scrollspy">
<h3 class="header">Left Aligned Links</h3>
<p>To left align your navbar links, just add a
<code class="language-markup">left</code> class to your
<code class="language-markup"><ul></code> that contains them.</p>
<nav>
<div class="nav-wrapper">
<div class="col s12">
<a href="navbar.html#!" class="brand-logo right">Logo</a>
<ul class="left hide-on-med-and-down">
<li>
<a href="sass.html">Sass</a>
</li>
<li>
<a href="badges.html">Components</a>
</li>
<li>
<a href="collapsible.html">JavaScript</a>
</li>
</ul>
</div>
</div>
</nav>
<br>
<pre><code class="language-markup">
<nav>
<div class="nav-wrapper">
<a href="#" class="brand-logo right">Logo</a>
<ul id="nav-mobile" class="left hide-on-med-and-down">
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
<li><a href="collapsible.html">JavaScript</a></li>
</ul>
</div>
</nav>
</code></pre>
</div>
<div id="center" class="section scrollspy">
<h3 class="header">Centering the logo</h3>
<p>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-markup">center</code> class to your
<code class="language-markup"><a class="brand-logo"></code>. You will have to make sure yourself that links do not overlap if you use this.</p>
<nav>
<div class="nav-wrapper">
<a href="navbar.html#!" class="brand-logo center">Logo</a>
<ul class="left hide-on-med-and-down">
<li>
<a href="sass.html">Sass</a>
</li>
<li>
<a href="badges.html">Components</a>
</li>
</ul>
</div>
</nav>
<br>
<pre><code class="language-markup">
<nav>
<div class="nav-wrapper">
<a href="#" class="brand-logo center">Logo</a>
<ul id="nav-mobile" class="left hide-on-med-and-down">
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
<li><a href="collapsible.html">JavaScript</a></li>
</ul>
</div>
</nav>
</code></pre>
</div>
<div id="active-label" class="section scrollspy">
<h3 class="header">Active Items</h3>
<p>
Add active class to your li tags to denote the current page.
</p>
<nav>
<div class="nav-wrapper">
<a href="navbar.html#!" class="brand-logo center">Logo</a>
<ul class="left hide-on-med-and-down">
<li>
<a href="sass.html">Sass</a>
</li>
<li>
<a href="badges.html">Components</a>
</li>
<li class="active">
<a href="collapsible.html">JavaScript</a>
</li>
</ul>
</div>
</nav>
<br>
<pre><code class="language-markup">
<nav>
<div class="nav-wrapper">
<a href="#!" class="brand-logo center">Logo</a>
<ul class="left hide-on-med-and-down">
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
<li class="active"><a href="collapsible.html">JavaScript</a></li>
</ul>
</div>
</nav>
</code></pre>
</div>
<div id="navbar-tabs" class="section scrollspy">
<h3 class="header">Extended Navbar with Tabs</h3>
<p>
To add extended components to the navbar, add the class
<code class="language-markup">nav-extended</code> to the outer
<span class="language-markup">nav</span> tag. This will allow your navbar height to be variable. Then you can just include a tabs component inside
the
<span class="language-markup">nav-wrapper</span>.
</p>
<nav class="nav-extended">
<div class="nav-wrapper">
<a href="navbar.html#" class="brand-logo">Logo</a>
<a href="navbar.html#" data-target="mobile-demo" class="sidenav-trigger">
<i class="material-icons">menu</i>
</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li>
<a href="sass.html">Sass</a>
</li>
<li>
<a href="badges.html">Components</a>
</li>
<li>
<a href="collapsible.html">JavaScript</a>
</li>
</ul>
</div>
<div class="nav-content">
<ul class="tabs tabs-transparent">
<li class="tab">
<a href="navbar.html#test1">Test 1</a>
</li>
<li class="tab">
<a class="active" href="navbar.html#test2">Test 2</a>
</li>
<li class="tab disabled">
<a href="navbar.html#test3">Disabled Tab</a>
</li>
<li class="tab">
<a href="navbar.html#test4">Test 4</a>
</li>
</ul>
</div>
</nav>
<ul class="sidenav" id="mobile-demo">
<li>
<a href="sass.html">Sass</a>
</li>
<li>
<a href="badges.html">Components</a>
</li>
<li>
<a href="collapsible.html">JavaScript</a>
</li>
</ul>
<br>
<div id="test1" class="col s12">Test 1</div>
<div id="test2" class="col s12">Test 2</div>
<div id="test3" class="col s12">Test 3</div>
<div id="test4" class="col s12">Test 4</div>
<br>
<pre><code class="language-markup">
<nav class="nav-extended">
<div class="nav-wrapper">
<a href="#" class="brand-logo">Logo</a>
<a href="#" data-target="mobile-demo" class="sidenav-trigger"><i class="material-icons">menu</i></a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
<li><a href="collapsible.html">JavaScript</a></li>
</ul>
</div>
<div class="nav-content">
<ul class="tabs tabs-transparent">
<li class="tab"><a href="#test1">Test 1</a></li>
<li class="tab"><a class="active" href="#test2">Test 2</a></li>
<li class="tab disabled"><a href="#test3">Disabled Tab</a></li>
<li class="tab"><a href="#test4">Test 4</a></li>
</ul>
</div>
</nav>
<ul class="sidenav" id="mobile-demo">
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
<li><a href="collapsible.html">JavaScript</a></li>
</ul>
<div id="test1" class="col s12">Test 1</div>
<div id="test2" class="col s12">Test 2</div>
<div id="test3" class="col s12">Test 3</div>
<div id="test4" class="col s12">Test 4</div>
</code></pre>
</div>
<div id="navbar-fixed" class="section scrollspy">
<h3 class="header">Fixed Navbar</h3>
<p>
To make the navbar fixed, you have to add an outer wrapping div with the class
<code class="language-markup">navbar-fixed</code>. This will offset your other content while making your nav fixed. You can adjust the height of this outer div
to change how much offset is on your content.
</p>
<pre><code class="language-markup">
<div class="navbar-fixed">
<nav>
<div class="nav-wrapper">
<a href="#!" class="brand-logo">Logo</a>
<ul class="right hide-on-med-and-down">
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
</ul>
</div>
</nav>
</div>
</code></pre>
</div>
<div id="navbar-dropdown" class="section scrollspy">
<h3 class="header">Navbar Dropdown Menu</h3>
<p>
To add a navbar dropdown menu, add the
<code class="language-markup">ul</code> dropdown structure into the page. Then, add an element to trigger the dropdown menu. Make sure to supply the id
of the dropdown structure to the
<code class="language-markup">data-target</code> attribute of the dropdown trigger.
</p>
<!-- Dropdown Structure -->
<ul id="dropdown1" class="dropdown-content">
<li>
<a href="navbar.html#!">one</a>
</li>
<li>
<a href="navbar.html#!">two</a>
</li>
<li class="divider"></li>
<li>
<a href="navbar.html#!">three</a>
</li>
</ul>
<nav>
<div class="nav-wrapper">
<a href="navbar.html#!" class="brand-logo">Logo</a>
<ul class="right hide-on-med-and-down">
<li>
<a href="sass.html">Sass</a>
</li>
<li>
<a href="badges.html">Components</a>
</li>
<!-- Dropdown Trigger -->
<li>
<a class="dropdown-trigger" href="navbar.html#!" data-target="dropdown1">Dropdown
<i class="material-icons right">arrow_drop_down</i>
</a>
</li>
</ul>
</div>
</nav>
<br>
<pre><code class="language-markup">
<!-- Dropdown Structure -->
<ul id="dropdown1" class="dropdown-content">
<li><a href="#!">one</a></li>
<li><a href="#!">two</a></li>
<li class="divider"></li>
<li><a href="#!">three</a></li>
</ul>
<nav>
<div class="nav-wrapper">
<a href="#!" class="brand-logo">Logo</a>
<ul class="right hide-on-med-and-down">
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
<!-- Dropdown Trigger -->
<li><a class="dropdown-trigger" href="#!" data-target="dropdown1">Dropdown<i class="material-icons right">arrow_drop_down</i></i></a></li>
</ul>
</div>
</nav>
</code></pre>
<p>To activate the dropdown menu, insert this line of code into your JavaScript file, within the
<code class="language-javascript">$( document ).ready(function)</code> block</p>
<pre><code class="language-javascript">
$(".dropdown-trigger").dropdown();
</code></pre>
<h5>Trigger dropdown menu on click</h5>
<p>
By default, the dropdown menu is activated by hovering over the dropdown trigger. To activate the dropdown menu on click,
pass
<code class="language-javascript">{ hover: false }</code> into the above
<code class="language-javascript">dropdown()</code> function
</p>
</div>
<div id="icons" class="section scrollspy">
<h3 class="header">Icon Links</h3>
<nav>
<div class="nav-wrapper">
<a href="navbar.html#!" class="brand-logo">
<i class="material-icons">cloud</i>Logo</a>
<ul class="right hide-on-med-and-down">
<li>
<a href="sass.html">
<i class="material-icons">search</i>
</a>
</li>
<li>
<a href="badges.html">
<i class="material-icons">view_module</i>
</a>
</li>
<li>
<a href="collapsible.html">
<i class="material-icons">refresh</i>
</a>
</li>
<li>
<a href="mobile.html">
<i class="material-icons">more_vert</i>
</a>
</li>
</ul>
</div>
</nav>
<br>
<p>You can add icons into links. For icon only links you don't need any additional class. Just pop the
<code class="language-markup">i</code> tag in and it will work.</p>
<pre><code class="language-markup">
<nav>
<div class="nav-wrapper">
<a href="#!" class="brand-logo"><i class="material-icons">cloud</i>Logo</a>
<ul class="right hide-on-med-and-down">
<li><a href="sass.html"><i class="material-icons">search</i></a></li>
<li><a href="badges.html"><i class="material-icons">view_module</i></a></li>
<li><a href="collapsible.html"><i class="material-icons">refresh</i></a></li>
<li><a href="mobile.html"><i class="material-icons">more_vert</i></a></li>
</ul>
</div>
</nav></code></pre>
<br>
<nav>
<div class="nav-wrapper">
<a href="navbar.html#!" class="brand-logo">Logo</a>
<ul class="right hide-on-med-and-down">
<li>
<a href="sass.html">
<i class="material-icons left">search</i>Link with Left Icon</a>
</li>
<li>
<a href="badges.html">
<i class="material-icons right">view_module</i>
</i>Link with Right Icon</a>
</li>
</ul>
</div>
</nav>
<br>
<p>For adding an icon to a text link you need to add either a
<code class="language-markup">left</code> or
<code class="language-markup">right</code> class to the icon depending on where you want the icon to be.</p>
<pre><code class="language-markup">
<nav>
<div class="nav-wrapper">
<a href="#!" class="brand-logo">Logo</a>
<ul class="right hide-on-med-and-down">
<li><a href="sass.html"><i class="material-icons left">search</i>Link with Left Icon</a></li>
<li><a href="badges.html"><i class="material-icons right">view_module</i></i>Link with Right Icon</a></li>
</ul>
</div>
</nav></code></pre>
<br>
</div>
<div id="buttons" class="section scrollspy">
<h3 class="header">Buttons</h3>
<nav>
<div class="nav-wrapper">
<a href="navbar.html#!" class="brand-logo">Logo</a>
<ul class="right hide-on-med-and-down">
<li>
<a class="waves-effect waves-light btn">Button</a>
</li>
<li>
<a class="waves-effect waves-light btn">Button
<i class="material-icons right">cloud</i>
</a>
</li>
<li>
<a class="waves-effect waves-light btn-large">Large Button</a>
</li>
</ul>
</div>
</nav>
<br>
<p>You can add buttons into links. For buttons you don't need any additional class. Just pop the
<code class="language-markup">.btn</code> class on the
<code class="language-markup">a</code> tag.</p>
<pre><code class="language-markup">
<nav>
<div class="nav-wrapper">
<a href="#!" class="brand-logo">Logo</a>
<ul class="right hide-on-med-and-down">
<li><a class="waves-effect waves-light btn">Button</a></li>
<li><a class="waves-effect waves-light btn">Button <i class="material-icons right">cloud</i></a></li>
<li><a class="waves-effect waves-light btn-large">Large Button</a></li>
</ul>
</div>
</nav></code></pre>
<br>
<h5>Halfway FAB in Extended Navbar</h5>
<p>Add a halfway FAB to your extended navbar.</p>
<nav class="nav-extended">
<div class="nav-wrapper">
<a href="navbar.html#!" class="brand-logo">Logo</a>
<ul class="right hide-on-med-and-down">
<li>
<a>A link</a>
</li>
<li>
<a>A second link</a>
</li>
<li>
<a>A third link</a>
</li>
</ul>
</div>
<div class="nav-content">
<span class="nav-title">Title</span>
<a class="btn-floating btn-large halfway-fab waves-effect waves-light teal">
<i class="material-icons">add</i>
</a>
</div>
</nav>
<br>
<br>
<pre><code class="language-markup">
<nav class="nav-extended">
<div class="nav-wrapper">
<a href="#!" class="brand-logo">Logo</a>
<ul class="right hide-on-med-and-down">
<li><a>A link</a></li>
<li><a>A second link</a></li>
<li><a>A third link</a></li>
</ul>
</div>
<div class="nav-content">
<span class="nav-title">Title</span>
<a class="btn-floating btn-large halfway-fab waves-effect waves-light teal">
<i class="material-icons">add</i>
</a>
</div>
</nav></code></pre>
<br>
</div>
<div id="search-docs" class="section scrollspy">
<h3 class="header">Search Bar</h3>
<nav>
<div class="nav-wrapper">
<form>
<div class="input-field">
<input id="search-example" type="search" required>
<label class="label-icon" for="search-example">
<i class="material-icons">search</i>
</label>
<i class="material-icons">close</i>
</div>
</form>
</div>
</nav>
<br>
<p>You can add a search form in the navbar.</p>
<pre><code class="language-markup">
<nav>
<div class="nav-wrapper">
<form>
<div class="input-field">
<input id="search" type="search" required>
<label class="label-icon" for="search"><i class="material-icons">search</i></label>
<i class="material-icons">close</i>
</div>
</form>
</div>
</nav></code></pre>
<br>
</div>
<div id="mobile-collapse" class="section scrollspy">
<h3 class="header">Mobile Collapse Button</h3>
<nav>
<div class="nav-wrapper">
<a href="navbar.html#!" class="brand-logo">Logo</a>
<a href="navbar.html#" data-target="mobile-demo" class="sidenav-trigger">
<i class="material-icons">menu</i>
</a>
<ul class="right hide-on-med-and-down">
<li>
<a href="sass.html">Sass</a>
</li>
<li>
<a href="badges.html">Components</a>
</li>
<li>
<a href="collapsible.html">Javascript</a>
</li>
<li>
<a href="mobile.html">Mobile</a>
</li>
<li>
<a class="btn waves-effect waves-light" href="buttons.html">Buttons</a>
</li>
</ul>
</div>
</nav>
<ul class="sidenav" id="mobile-demo">
<li>
<a href="sass.html">Sass</a>
</li>
<li>
<a href="badges.html">Components</a>
</li>
<li>
<a href="collapsible.html">Javascript</a>
</li>
<li>
<a href="mobile.html">Mobile</a>
</li>
<li>
<a class="btn waves-effect waves-light" href="buttons.html">Buttons</a>
</li>
</ul>
<br>
<p>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 below to get this functionality. Add the entire
<code class="language-markup">sidenav-trigger</code> line to your
<code class="language-markup">nav</code>.</p>
<pre><code class="language-markup">
<nav>
<div class="nav-wrapper">
<a href="#!" class="brand-logo">Logo</a>
<a href="#" data-target="mobile-demo" class="sidenav-trigger"><i class="material-icons">menu</i></i></a>
<ul class="right hide-on-med-and-down">
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
<li><a href="collapsible.html">Javascript</a></li>
<li><a href="mobile.html">Mobile</a></li>
</ul>
</div>
</nav>
<ul class="sidenav" id="mobile-demo">
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
<li><a href="collapsible.html">Javascript</a></li>
<li><a href="mobile.html">Mobile</a></li>
</ul>
</code></pre>
<br>
<h5>Initialization</h5>
<p>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 classes in the above example. In the case that you have, just change the
selector in the line below to match it.</p>
<pre><code class="language-javascript">
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.sidenav');
var instances = M.Sidenav.init(elems, options);
});
// Or with jQuery
$(document).ready(function(){
$('.sidenav').sidenav();
});
</code></pre>
</div>
</div>
<div class="col hide-on-small-only m3 xl3 offset-xl1">
<div class="toc-wrapper">
<div class="buysellads hide-on-small-only">
<!-- CarbonAds Zone Code -->
<script async type="text/javascript" src="https://cdn.carbonads.com/carbon.js?serve=CKYIK27J&placement=materializecss" id="_carbonads_js"></script>
</div>
<div style="height: 1px;">
<ul class="section table-of-contents">
<li>
<a href="navbar.html#right">Right Aligned</a>
</li>
<li>
<a href="navbar.html#left">Left Aligned</a>
</li>
<li>
<a href="navbar.html#center">Center Logo</a>
</li>
<li>
<a href="navbar.html#active-label">Active Items</a>
</li>
<li>
<a href="navbar.html#navbar-tabs">Navbar with Tabs</a>
</li>
<li>
<a href="navbar.html#navbar-fixed">Fixed Navbar</a>
</li>
<li>
<a href="navbar.html#navbar-dropdown">Dropdown Menu</a>
</li>
<li>
<a href="navbar.html#icons">Icon Links</a>
</li>
<li>
<a href="navbar.html#buttons">Buttons</a>
</li>
<li>
<a href="navbar.html#search-docs">Search Bar</a>
</li>
<li>
<a href="navbar.html#mobile-collapse">Mobile Collapse</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</main> <footer class="page-footer docs-footer">
<div class="container">
<div class="row" style="margin-bottom: 0;">
<div class="col s12 m10 offset-m1">
<div class="row">
<div class="col l4 s12">
<h5>Help Materialize Grow</h5>
<p class="grey-text text-darken-2">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.</p>
<a class="btn waves-effect waves-light red lighten-2" href="support-us.html">Support Us</a>
</div>
<div class="col l4 s12">
<h5>Join the Discussion</h5>
<p class="grey-text text-darken-2">We have a Gitter chat room set up where you can talk directly with us. Come in and discuss new features, future goals, general problems or questions, or anything else you can think of.</p>
<a class="btn waves-effect waves-light red lighten-2" target="_blank" href="https://gitter.im/Dogfalo/materialize">Chat</a>
</div>
<div class="col l4 s12" style="overflow: hidden;">
<h5>Connect</h5>
<iframe src="https://ghbtns.com/github-btn.html?user=dogfalo&repo=materialize&type=watch&count=true&size=large" allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe>
<br>
<a href="https://twitter.com/MaterializeCSS" class="twitter-follow-button" data-show-count="true" data-size="large" data-dnt="true">Follow @MaterializeCSS</a>
<br>
<div class="g-follow" data-annotation="bubble" data-height="24" data-href="https://plus.google.com/108619793845925798422" data-rel="publisher"></div>
</div>
</div>
<div class="row">
<div class="col s12">
<h5>Patreon Sponsors</h5>
</div>
<div class="col s12">
<div class="patreon-footer-ad">
<a href="https://www.keycdn.com" target="_blank" rel="noopener">
<img src="https://s7.postimg.cc/qefeablln/keycdn.png" alt="KeyCDN">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://ironmansoftware.com/universal-dashboard" target="_blank" rel="noopener">
<img src="https://s7.postimg.cc/cnax82u2z/universal-dashboard.png" alt="Universal Dashboard">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://www.spaculus.org/?s=p" target="_blank" rel="noopener">
<img src="https://s8.postimg.cc/vigwx9a0l/spaculus-logo.png" alt="Spaculus">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://wrappixel.com/" target="_blank" rel="noopener">
<img src="https://s14.postimg.cc/6u3tdxw81/wrappixel-logo.jpg" alt="WrapPixel">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://cryptoefx.com" target="_blank" rel="noopener">
<img src="https://s14.postimg.cc/gs1o4wy29/crypto-_EFX.png" alt="crypto EFX">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://webdock.io/en" target="_blank" rel="noopener">
<img src="https://s15.postimg.cc/3k2228kcb/ezgif.com-gif-maker.png" alt="Webdock">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://cryptapi.io" target="_blank" rel="noopener">
<img src="https://s15.postimg.cc/nmkoqq84r/white_bg.png" alt="CryptAPI">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://hostpresto.com/?utm_source=materializecss" target="_blank" rel="noopener">
<img src="https://s15.postimg.cc/4hhfhcyq3/hostpresto.png" alt="HostPresto">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://www.seareach.plc.uk/" target="_blank" rel="noopener">
<img src="https://s15.postimg.cc/6cqo8j30r/Seareach_LOGO_4_COL.png" alt="Seareach">
</a>
</div>
<div class="patreon-footer-ad">
<a href="http://lucidocean.com" target="_blank" rel="noopener">
<img src="https://s8.postimg.cc/762csselh/logo_full_size.png" alt="Lucid Ocean">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://www.stillio.com/" target="_blank" rel="noopener">
<img src="https://s13.postimg.cc/hcpyykzbr/stillio-as-logo-1000-green.png" title="Capture and archive website screenshots automatically with Stillio" alt="Capture and archive website screenshots automatically with Stillio">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://gaggle.email/" target="_blank" rel="noopener">
<img src="https://s13.postimg.cc/oqns3tzmf/gaggle-mail-logo.png" alt="Gaggle Mail">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://icons8.com/material-icons" target="_blank" rel="noopener">
<img src="https://s13.postimg.cc/q0lliz153/icons8-logo-opencollective.png" alt="Icons8">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://keymedium.com" target="_blank" rel="noopener">
<img src="https://s13.postimg.cc/m9c0wcpxz/2017-10-23-logo-refresh.png" alt="Philadelphia Web Design & SEO Agency">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://www.brandnewweb.nl" target="_blank" rel="noopener">
<img src="https://s13.postimg.cc/3pxqiuqyf/brandnewweb.png" alt="Brand New Web">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://typestack.nl" target="_blank" rel="noopener">
<img src="https://s13.postimg.cc/6k0vwalev/typestack.png" alt="Open source fully loaded CMS in #2019">
</a>
</div>
<div class="patreon-footer-ad">
<a href="https://www.yourlabs.biz" target="_blank" rel="noopener">
<img src="https://avatars0.githubusercontent.com/u/1040547?s=200&v=4" alt="YourLabs Business Service: Digital Strategy Consulting" title="YourLabs Business Service: Digital Strategy Consulting">
</a>
</div>
</div>
</div>
<div class="footer-copyright">
© 2014-<noscript>2018</noscript><script type="text/javascript">document.write(new Date().getFullYear());</script> Materialize, All rights reserved.
<a class="grey-text text-darken-1 right" href="https://github.com/Dogfalo/materialize/blob/master/LICENSE">MIT License</a>
</div>
</div>
</div>
</div>
</footer>
<!-- Scripts-->
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>