navbar.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860
  1. ---
  2. layout: documentation
  3. doc-tab: components
  4. doc-subtab: navbar
  5. ---
  6. {% include subnav-components.html %}
  7. {% capture navbar_example %}
  8. {% include navbar.html id="Example" %}
  9. {% endcapture %}
  10. {% capture navbar_brand_example %}
  11. <nav class="navbar">
  12. <div class="navbar-brand">
  13. <!-- navbar items, navbar burger ... -->
  14. </div>
  15. </nav>
  16. {% endcapture %}
  17. {% capture navbar_burger_example %}
  18. <div class="navbar-burger">
  19. <span></span>
  20. <span></span>
  21. <span></span>
  22. </div>
  23. {% endcapture %}
  24. {% capture navbar_brand_items_example %}
  25. <nav class="navbar">
  26. <div class="navbar-brand">
  27. <a class="navbar-item" href="{{ site.url }}">
  28. <img src="{{ site.url }}/images/bulma-logo.png" alt="{{ site.title }}" width="112" height="28">
  29. </a>
  30. <div class="navbar-burger">
  31. <span></span>
  32. <span></span>
  33. <span></span>
  34. </div>
  35. </div>
  36. </nav>
  37. {% endcapture %}
  38. {% capture navbar_menu_example %}
  39. <nav class="navbar">
  40. <div class="navbar-brand">
  41. <!-- navbar items, nav burger ... -->
  42. </div>
  43. <div class="navbar-menu">
  44. <!-- navbar start, navbar end -->
  45. </div>
  46. </nav>
  47. {% endcapture %}
  48. {% capture navbar_menu_active_example %}
  49. <div class="navbar-menu">
  50. <!-- hidden on mobile -->
  51. </div>
  52. <div class="navbar-menu is-active">
  53. <!-- shown on mobile -->
  54. </div>
  55. {% endcapture %}
  56. {% capture navbar_start_end_example %}
  57. <div class="navbar-menu">
  58. <div class="navbar-start">
  59. <!-- navbar items -->
  60. </div>
  61. <div class="navbar-end">
  62. <!-- navbar items -->
  63. </div>
  64. </div>
  65. {% endcapture %}
  66. {% capture navbar_item_link_example %}
  67. <a class="navbar-item">
  68. Home
  69. </a>
  70. {% endcapture %}
  71. {% capture navbar_item_brand_example %}
  72. <a class="navbar-item">
  73. <img src="{{ site.url }}/images/bulma-logo.png" width="112" height="28">
  74. </a>
  75. {% endcapture %}
  76. {% capture navbar_item_dropdown_example %}
  77. <div class="navbar-item has-dropdown">
  78. <a class="navbar-link">
  79. Docs
  80. </a>
  81. <div class="navbar-dropdown">
  82. <!-- Other navbar items -->
  83. </div>
  84. </div>
  85. {% endcapture %}
  86. {% capture navbar_item_dropdown_bis_example %}
  87. <div class="navbar-dropdown">
  88. <a class="navbar-item">
  89. Overview
  90. </a>
  91. </div>
  92. {% endcapture %}
  93. {% capture navbar_item_other_example %}
  94. <div class="navbar-item">
  95. <div class="field is-grouped">
  96. <p class="control">
  97. <a id="class="button">
  98. <span class="icon">
  99. <i class="fa fa-twitter"></i>
  100. </span>
  101. <span>Tweet</span>
  102. </a>
  103. </p>
  104. <p class="control">
  105. <a class="button is-primary">
  106. <span class="icon">
  107. <i class="fa fa-download"></i>
  108. </span>
  109. <span>Download</span>
  110. </a>
  111. </p>
  112. </div>
  113. </div>
  114. {% endcapture %}
  115. {% capture navbar_transparent_example %}
  116. {% include navbar.html transparent=true boxed=true id="TransparentExample" %}
  117. {% endcapture %}
  118. {% capture navbar_dropdown_example %}
  119. <nav class="navbar">
  120. <div class="navbar-item has-dropdown">
  121. <a class="navbar-link">
  122. Docs
  123. </a>
  124. <div class="navbar-dropdown">
  125. <a class="navbar-item">
  126. Overview
  127. </a>
  128. <a class="navbar-item">
  129. Elements
  130. </a>
  131. <a class="navbar-item">
  132. Components
  133. </a>
  134. <hr class="navbar-divider">
  135. <div class="navbar-item">
  136. Version {{ site.version }}
  137. </div>
  138. </div>
  139. </div>
  140. </nav>
  141. {% endcapture %}
  142. {% capture navbar_dropdown_hover_example %}
  143. <nav class="navbar">
  144. <div class="navbar-item has-dropdown is-hoverable">
  145. <a class="navbar-link">
  146. Docs
  147. </a>
  148. <div class="navbar-dropdown">
  149. <a class="navbar-item">
  150. Overview
  151. </a>
  152. <a class="navbar-item">
  153. Elements
  154. </a>
  155. <a class="navbar-item">
  156. Components
  157. </a>
  158. <hr class="navbar-divider">
  159. <div class="navbar-item">
  160. Version {{ site.version }}
  161. </div>
  162. </div>
  163. </div>
  164. </nav>
  165. {% endcapture %}
  166. {% capture navbar_dropdown_active_example %}
  167. <nav class="navbar">
  168. <div class="navbar-item has-dropdown is-active">
  169. <a class="navbar-link">
  170. Docs
  171. </a>
  172. <div class="navbar-dropdown">
  173. <a class="navbar-item">
  174. Overview
  175. </a>
  176. <a class="navbar-item">
  177. Elements
  178. </a>
  179. <a class="navbar-item">
  180. Components
  181. </a>
  182. <hr class="navbar-divider">
  183. <div class="navbar-item">
  184. Version {{ site.version }}
  185. </div>
  186. </div>
  187. </div>
  188. </nav>
  189. {% endcapture %}
  190. {% capture navbar_dropdown_default_example %}
  191. <nav class="navbar">
  192. <a class="navbar-item">
  193. <img src="{{ site.url }}/images/bulma-logo.png" alt="{{ site.title }}" width="112" height="28">
  194. </a>
  195. <div class="navbar-item has-dropdown is-active">
  196. <a class="navbar-link">
  197. Docs
  198. </a>
  199. <div class="navbar-dropdown">
  200. <a class="navbar-item">
  201. Overview
  202. </a>
  203. <a class="navbar-item">
  204. Elements
  205. </a>
  206. <a class="navbar-item">
  207. Components
  208. </a>
  209. <hr class="navbar-divider">
  210. <div class="navbar-item">
  211. Version {{ site.version }}
  212. </div>
  213. </div>
  214. </div>
  215. </nav>
  216. <section class="hero is-primary">
  217. <div class="hero-body">
  218. <p class="title">
  219. Documentation
  220. </p>
  221. <p class="subtitle">
  222. Everything you need to <strong>create a website</strong> with Bulma
  223. </p>
  224. </div>
  225. </section>
  226. {% endcapture %}
  227. {% capture navbar_dropdown_boxed_example %}
  228. <nav class="navbar is-transparent">
  229. <a class="navbar-item">
  230. <img src="{{ site.url }}/images/bulma-logo.png" alt="{{ site.title }}" width="112" height="28">
  231. </a>
  232. <div class="navbar-item has-dropdown is-active">
  233. <a class="navbar-link">
  234. Docs
  235. </a>
  236. <div class="navbar-dropdown is-boxed">
  237. <a class="navbar-item">
  238. Overview
  239. </a>
  240. <a class="navbar-item">
  241. Elements
  242. </a>
  243. <a class="navbar-item">
  244. Components
  245. </a>
  246. <hr class="navbar-divider">
  247. <div class="navbar-item">
  248. Version {{ site.version }}
  249. </div>
  250. </div>
  251. </div>
  252. </nav>
  253. <section class="hero">
  254. <div class="hero-body">
  255. <p class="title">
  256. Documentation
  257. </p>
  258. <p class="subtitle">
  259. Everything you need to <strong>create a website</strong> with Bulma
  260. </p>
  261. </div>
  262. </section>
  263. {% endcapture %}
  264. {% capture navbar_dropdown_item_active_example %}
  265. <nav class="navbar">
  266. <a class="navbar-item">
  267. <img src="{{ site.url }}/images/bulma-logo.png" alt="{{ site.title }}" width="112" height="28">
  268. </a>
  269. <div class="navbar-item has-dropdown is-active">
  270. <a class="navbar-link">
  271. Docs
  272. </a>
  273. <div class="navbar-dropdown">
  274. <a class="navbar-item">
  275. Overview
  276. </a>
  277. <a class="navbar-item is-active">
  278. Elements
  279. </a>
  280. <a class="navbar-item">
  281. Components
  282. </a>
  283. <hr class="navbar-divider">
  284. <div class="navbar-item">
  285. Version {{ site.version }}
  286. </div>
  287. </div>
  288. </div>
  289. </nav>
  290. <section class="hero is-primary">
  291. <div class="hero-body">
  292. <p class="title">
  293. Documentation
  294. </p>
  295. <p class="subtitle">
  296. Everything you need to <strong>create a website</strong> with Bulma
  297. </p>
  298. </div>
  299. </section>
  300. {% endcapture %}
  301. {% capture navbar_divider_example %}
  302. <hr class="navbar-divider">
  303. {% endcapture %}
  304. {% capture navbar_js_html %}
  305. <div class="navbar-burger" data-target="navMenu">
  306. <span></span>
  307. <span></span>
  308. <span></span>
  309. </div>
  310. <div class="navbar-menu" id="navMenu">
  311. <!-- navbar-start, navbar-end... -->
  312. </div>
  313. {% endcapture %}
  314. {% capture navbar_js_code %}
  315. document.addEventListener('DOMContentLoaded', function () {
  316. // Get all "navbar-burger" elements
  317. var $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
  318. // Check if there are any nav burgers
  319. if ($navbarBurgers.length > 0) {
  320. // Add a click event on each of them
  321. $navbarBurgers.forEach(function ($el) {
  322. $el.addEventListener('click', () => {
  323. // Get the target from the "data-target" attribute
  324. var target = $el.dataset.target;
  325. var $target = document.getElementById(target);
  326. // Toggle the class on both the "navbar-burger" and the "navbar-menu"
  327. $el.classList.toggle('is-active');
  328. $target.classList.toggle('is-active');
  329. });
  330. });
  331. }
  332. });
  333. {% endcapture %}
  334. <section class="section">
  335. <div class="container">
  336. <div class="columns" style="margin-bottom: -0.75rem !important;">
  337. <div class="column">
  338. <h1 class="title">Navbar</h1>
  339. <h2 class="subtitle">
  340. A responsive horizontal <strong>navbar</strong> that can supports images, links, buttons, and dropdowns
  341. </h2>
  342. </div>
  343. <div class="column is-narrow">
  344. <p class="content">
  345. <span class="tag is-success">New!</span>
  346. <span class="tag is-info">0.4.3</span>
  347. </p>
  348. </div>
  349. </div>
  350. <hr>
  351. <div class="message is-success">
  352. <div class="message-body">
  353. <p>The new <code>navbar</code> replaces the deprecated <code>nav</code> component, whose documentation you can still access temporarily <a href="{{ site.url }}/documentation/components/nav/">here</a>.</p>
  354. </div>
  355. </div>
  356. <div class="content">
  357. <p>
  358. The <code>navbar</code> component is a responsive and versatile horizontal navigation bar with the following structure:
  359. </p>
  360. <ul>
  361. <li>
  362. <code>navbar</code> the <strong>main</strong> container
  363. <ul>
  364. <li>
  365. <code>navbar-brand</code> the <strong>left side</strong>, <strong class="has-text-success">always visible</strong>, which usually contains the <strong>logo</strong> and optionally some links or icons
  366. <ul>
  367. <li>
  368. <code>navbar-burger</code> the <strong>hamburger</strong> icon, which toggles the navbar menu on touch devices
  369. </li>
  370. </ul>
  371. </li>
  372. <li>
  373. <code>navbar-menu</code> the <strong>right side</strong>, hidden on touch devices, visible on desktop
  374. <ul>
  375. <li>
  376. <code>navbar-start</code> the <strong>left part</strong> of the menu, which appears next to the navbar brand on desktop
  377. </li>
  378. <li>
  379. <code>navbar-end</code> the <strong>right part</strong> of the menu, which appears at the end of the navbar
  380. <ul>
  381. <li>
  382. <code>navbar-item</code> each <strong>single item</strong> of the navbar, which can either be a <code>a</code> or a <code>div</code>
  383. <ul>
  384. <li>
  385. <code>navbar-link</code> a <strong>link</strong> as the sibling of a dropdown, with an arrow
  386. </li>
  387. <li>
  388. <code>navbar-dropdown</code> the <strong>dropdown menu</strong>, which can include navbar items and dividers
  389. <ul>
  390. <li>
  391. <code>navbar-divider</code> a <strong>horizontal line</strong> to separate navbar items
  392. </li>
  393. </ul>
  394. </li>
  395. </ul>
  396. </li>
  397. </ul>
  398. </li>
  399. </ul>
  400. </li>
  401. </ul>
  402. </li>
  403. </ul>
  404. </div>
  405. <div class="example is-paddingless">
  406. {{navbar_example}}
  407. </div>
  408. {% highlight html %}{{navbar_example}}{% endhighlight %}
  409. <hr>
  410. <h3 class="title">Navbar brand</h3>
  411. <div class="content">
  412. <p>
  413. The <code>navbar-brand</code> is the left side of the navbar. It can contain:
  414. </p>
  415. <ul>
  416. <li>
  417. a number of <code>navbar-item</code>
  418. </li>
  419. <li>
  420. the <code>navbar-burger</code> as last child
  421. </li>
  422. </ul>
  423. </div>
  424. {% highlight html %}{{navbar_brand_example}}{% endhighlight %}
  425. <div class="content">
  426. <p>
  427. The navbar brand is <strong>always visible</strong>: on both touch devices {% include bp/touch.html %} and desktop {% include bp/desktop.html %}. As a result, it is recommended to only use a few navbar items to avoid <strong>overflowing</strong> horizontally on small devices.
  428. </p>
  429. </div>
  430. <div class="example is-paddingless">
  431. {{navbar_brand_items_example}}
  432. </div>
  433. {% highlight html %}{{navbar_brand_items_example}}{% endhighlight %}
  434. <div class="content">
  435. <p>
  436. On desktop {% include bp/desktop.html %}, the navbar brand will only take up the space it needs.
  437. </p>
  438. </div>
  439. <hr>
  440. <h3 class="title">Navbar burger</h3>
  441. <div class="content">
  442. <p>
  443. The <code>navbar-burger</code> is a hamburger menu that only appears on <strong>mobile</strong>. It has to appear as the last child of <code>navbar-brand</code>.
  444. </p>
  445. </div>
  446. <div class="example is-paddingless">
  447. <div class="navbar-burger" style="display: flex;">
  448. <span></span>
  449. <span></span>
  450. <span></span>
  451. </div>
  452. </div>
  453. {% highlight html %}{{ navbar_burger_example }}{% endhighlight %}
  454. <div class="content">
  455. <p>
  456. You can add the modifier class <code>is-active</code> to turn it into a cross.
  457. </p>
  458. </div>
  459. <div class="example is-paddingless">
  460. <div class="navbar-burger is-active" style="display: flex;">
  461. <span></span>
  462. <span></span>
  463. <span></span>
  464. </div>
  465. </div>
  466. <hr>
  467. <h3 class="title">Navbar menu</h3>
  468. <div class="content">
  469. <p>
  470. The <code>navbar-menu</code> is the <strong>counterpart</strong> of the navbar brand. As such, it must appear as a direct child of <code>navbar</code>, as a sibling of <code>navbar-brand</code>.
  471. </p>
  472. </div>
  473. {% highlight html %}{{navbar_menu_example}}{% endhighlight %}
  474. <div class="content">
  475. <p>
  476. The <code>navbar-menu</code> is <strong>hidden on touch devices</strong> {% include bp/touch.html %}. You need to add the modifier class <code>is-active</code> to display it.
  477. </p>
  478. </div>
  479. {% highlight html %}{{navbar_menu_active_example}}{% endhighlight %}
  480. <div class="content">
  481. <p>
  482. On desktop {% include bp/desktop.html %}, the <code>navbar-menu</code> will <strong>fill up the space</strong> available in the navbar, leaving the navbar brand just the space it needs. It needs, however, two elements as direct children:
  483. </p>
  484. <ul>
  485. <li>
  486. <code>navbar-start</code>
  487. </li>
  488. <li>
  489. <code>navbar-end</code>
  490. </li>
  491. </ul>
  492. </div>
  493. <hr>
  494. <div id="navbarJsExample" class="message is-info">
  495. <h4 class="message-header">Javascript toggle</h4>
  496. <div class="message-body">
  497. <div class="content">
  498. <p>
  499. The Bulma package <strong>does not come with any JavaScript</strong>.
  500. <br>
  501. Here is however an implementation example, which toggles the class <code>is-active</code> on both the <code>navbar-burger</code> and the targeted <code>navbar-menu</code>.
  502. </p>
  503. {% highlight html %}{{ navbar_js_html }}{% endhighlight %}
  504. {% highlight javascript %}{{ navbar_js_code }}{% endhighlight %}
  505. </div>
  506. </div>
  507. </div>
  508. <hr>
  509. <h3 class="title">Navbar start and navbar end</h3>
  510. <div class="content">
  511. <p>
  512. The <code>navbar-start</code> and <code>navbar-end</code> are the two direct and only children of the <code>navbar-menu</code>.
  513. </p>
  514. <p>
  515. On desktop {% include bp/desktop.html %}:
  516. </p>
  517. <ul>
  518. <li>
  519. <code>navbar-start</code> will appear on the <strong>left</strong>
  520. </li>
  521. <li>
  522. <code>navbar-end</code> will appear on the <strong>right</strong>
  523. </li>
  524. </ul>
  525. <p>
  526. Each of them can contain any number of <code>navbar-item</code>.
  527. </p>
  528. </div>
  529. {% highlight html %}{{navbar_start_end_example}}{% endhighlight %}
  530. <hr>
  531. <h3 class="title">Navbar item</h3>
  532. <div class="content">
  533. <p>
  534. A <code>navbar-item</code> is a repeatable element that can be:
  535. </p>
  536. <ul>
  537. <li>
  538. a navigation <strong>link</strong>
  539. {% highlight html %}{{ navbar_item_link_example }}{% endhighlight %}
  540. </li>
  541. <li>
  542. a container for the <strong>brand logo</strong>
  543. {% highlight html %}{{ navbar_item_brand_example }}{% endhighlight %}
  544. </li>
  545. <li>
  546. the <strong>parent</strong> of a dropdown menu
  547. {% highlight html %}{{ navbar_item_dropdown_example }}{% endhighlight %}
  548. </li>
  549. <li>
  550. a child of a <strong>navbar dropdown</strong>
  551. {% highlight html %}{{ navbar_item_dropdown_bis_example }}{% endhighlight %}
  552. </li>
  553. <li>
  554. a container for almost <strong>anything</strong> you want, like a <code>field</code>
  555. {% highlight html %}{{ navbar_item_other_example }}{% endhighlight %}
  556. </li>
  557. </ul>
  558. <p>
  559. It can either be an anchor tag <code>&lt;a&gt;</code> or a <code>&lt;div&gt;</code>, as a <strong>direct child</strong> of either:
  560. </p>
  561. <ul>
  562. <li>
  563. <code>navbar</code>
  564. </li>
  565. <li>
  566. <code>navbar-brand</code>
  567. </li>
  568. <li>
  569. <code>navbar-start</code>
  570. </li>
  571. <li>
  572. <code>navbar-end</code>
  573. </li>
  574. <li>
  575. <code>navbar-dropdown</code>
  576. </li>
  577. </ul>
  578. </div>
  579. <hr>
  580. <h3 id="transparent-navbar" class="title">Transparent navbar</h3>
  581. <div class="content">
  582. <p>
  583. To seamlessly integrate the navbar in any visual context, you can add the <code>is-transparent</code> modifer on the <code>navbar</code> component. This will remove any hover or active background from the navbar items.
  584. </p>
  585. </div>
  586. <div class="example is-paddingless">
  587. {{navbar_transparent_example}}
  588. </div>
  589. {% highlight html %}{{navbar_transparent_example}}{% endhighlight %}
  590. <hr>
  591. <h3 id="dropdown-menu" class="title">Dropdown menu</h3>
  592. <div class="content">
  593. <p>
  594. To create a <strong>dropdown menu</strong>, you will need <strong>4</strong> elements:
  595. </p>
  596. <ul>
  597. <li>
  598. <code>navbar-item</code> with the <code>has-dropdown</code> modifier
  599. </li>
  600. <li>
  601. <code>navbar-link</code> which contains the dropdown arrow
  602. </li>
  603. <li>
  604. <code>navbar-dropdown</code> which can contain instances of <code>navbar-item</code> and <code>navbar-divider</code>
  605. </li>
  606. </ul>
  607. </div>
  608. <div class="columns">
  609. <div class="column">
  610. <div class="example is-paddingless">
  611. {{ navbar_dropdown_example }}
  612. </div>
  613. </div>
  614. <div class="column">
  615. {% highlight html %}{{ navbar_dropdown_example }}{% endhighlight %}
  616. </div>
  617. </div>
  618. <h4 class="title is-4">
  619. Show/hide the dropdown with either <strong>CSS</strong> or <strong>JavaScript</strong>
  620. </h4>
  621. <div class="content">
  622. <p>
  623. The <code>navbar-dropdown</code> is visible on touch devices {% include bp/touch.html %} but hidden on desktop {% include bp/desktop.html %}. <em>How</em> the dropdown is displayed on desktop depends on the parent's class.
  624. </p>
  625. <p>
  626. The <code>navbar-item</code> with the <code>has-dropdown</code> modifier, has <strong>2 additional modifiers</strong>
  627. </p>
  628. <ul>
  629. <li>
  630. <code>is-hoverable</code>: the dropdown will show up when <strong>hovering</strong> the parent <code>navbar-item</code>
  631. </li>
  632. <li>
  633. <code>is-active</code>: the dropdown will show up <strong>all the time</strong>
  634. </li>
  635. </ul>
  636. </div>
  637. <div class="message is-success">
  638. <p class="message-body">
  639. While the CSS <code>:hover</code> implementation works perfectly, the <code>is-active</code> class is available for users who want to control the display of the dropdown with <strong>JavaScript</strong>.
  640. </p>
  641. </div>
  642. <div class="columns">
  643. <div class="column">
  644. <div class="example is-paddingless">
  645. {{ navbar_dropdown_hover_example }}
  646. </div>
  647. </div>
  648. <div class="column">
  649. {% highlight html %}{{ navbar_dropdown_hover_example }}{% endhighlight %}
  650. </div>
  651. </div>
  652. <div class="columns">
  653. <div class="column">
  654. <div class="example is-paddingless">
  655. {{ navbar_dropdown_active_example }}
  656. </div>
  657. </div>
  658. <div class="column">
  659. {% highlight html %}{{ navbar_dropdown_active_example }}{% endhighlight %}
  660. </div>
  661. </div>
  662. <h4 class="title is-4">
  663. Styles for the dropdown menu
  664. </h4>
  665. <div class="content">
  666. <p>
  667. By default, the <code>navbar-dropdown</code> has:
  668. </p>
  669. <ul>
  670. <li>
  671. a grey <code>border-top</code>
  672. </li>
  673. <li>
  674. a <code>border-radius</code> at both bottom corners
  675. </li>
  676. </ul>
  677. </div>
  678. <div class="columns">
  679. <div class="column">
  680. <div class="example is-paddingless">
  681. {{ navbar_dropdown_default_example }}
  682. </div>
  683. </div>
  684. <div class="column">
  685. {% highlight html %}{{ navbar_dropdown_default_example }}{% endhighlight %}
  686. </div>
  687. </div>
  688. <div class="content">
  689. <p>
  690. When having a <a href="#transparent-navbar">transparent navbar</a>, it is preferable to use the boxed version of the dropdown, by using the <code>is-boxed</code> modifier.
  691. </p>
  692. <ul>
  693. <li>
  694. the grey border is <strong>removed</strong>
  695. </li>
  696. <li>
  697. a slight <strong>inner shadow</strong> is added
  698. </li>
  699. <li>
  700. all corners are <strong>rounded</strong>
  701. </li>
  702. <li>
  703. the hover/active state is <strong>animated</strong>
  704. </li>
  705. </ul>
  706. </div>
  707. <div class="columns">
  708. <div class="column">
  709. <div class="example is-paddingless">
  710. {{ navbar_dropdown_boxed_example }}
  711. </div>
  712. </div>
  713. <div class="column">
  714. {% highlight html %}{{ navbar_dropdown_boxed_example }}{% endhighlight %}
  715. </div>
  716. </div>
  717. <h4 class="title is-4">
  718. Active dropdown navbar item
  719. </h4>
  720. <div class="columns">
  721. <div class="column">
  722. <div class="example is-paddingless">
  723. {{ navbar_dropdown_item_active_example }}
  724. </div>
  725. </div>
  726. <div class="column">
  727. {% highlight html %}{{ navbar_dropdown_item_active_example }}{% endhighlight %}
  728. </div>
  729. </div>
  730. <h4 class="title is-4">
  731. Dropdown divider
  732. </h4>
  733. <div class="content">
  734. <p>
  735. You can add a <code>navbar-divider</code> to display a <strong>horizontal rule</strong> in a <code>navbar-dropdown</code>.
  736. </p>
  737. </div>
  738. {% highlight html %}{{ navbar_divider_example }}{% endhighlight %}
  739. </div>
  740. </section>