level.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. ---
  2. layout: documentation
  3. doc-tab: layout
  4. doc-subtab: level
  5. ---
  6. {% capture nav_example %}
  7. <!-- Main container -->
  8. <nav class="level">
  9. <!-- Left side -->
  10. <div class="level-left">
  11. <div class="level-item">
  12. <p class="subtitle is-5">
  13. <strong>123</strong> posts
  14. </p>
  15. </div>
  16. <div class="level-item">
  17. <div class="field has-addons">
  18. <p class="control">
  19. <input class="input" type="text" placeholder="Find a post">
  20. </p>
  21. <p class="control">
  22. <button class="button">
  23. Search
  24. </button>
  25. </p>
  26. </div>
  27. </div>
  28. </div>
  29. <!-- Right side -->
  30. <div class="level-right">
  31. <p class="level-item"><strong>All</strong></p>
  32. <p class="level-item"><a>Published</a></p>
  33. <p class="level-item"><a>Drafts</a></p>
  34. <p class="level-item"><a>Deleted</a></p>
  35. <p class="level-item"><a class="button is-success">New</a></p>
  36. </div>
  37. </nav>
  38. {% endcapture %}
  39. {% capture nav_centered_example %}
  40. <nav class="level">
  41. <div class="level-item has-text-centered">
  42. <div>
  43. <p class="heading">Tweets</p>
  44. <p class="title">3,456</p>
  45. </div>
  46. </div>
  47. <div class="level-item has-text-centered">
  48. <div>
  49. <p class="heading">Following</p>
  50. <p class="title">123</p>
  51. </div>
  52. </div>
  53. <div class="level-item has-text-centered">
  54. <div>
  55. <p class="heading">Followers</p>
  56. <p class="title">456K</p>
  57. </div>
  58. </div>
  59. <div class="level-item has-text-centered">
  60. <div>
  61. <p class="heading">Likes</p>
  62. <p class="title">789</p>
  63. </div>
  64. </div>
  65. </nav>
  66. {% endcapture %}
  67. {% capture nav_centered_bis_example %}
  68. <nav class="level">
  69. <p class="level-item has-text-centered">
  70. <a class="link is-info">Home</a>
  71. </p>
  72. <p class="level-item has-text-centered">
  73. <a class="link is-info">Menu</a>
  74. </p>
  75. <p class="level-item has-text-centered">
  76. <img src="{{ site.url }}/images/bulma-type.png" alt="" style="height: 30px;">
  77. </p>
  78. <p class="level-item has-text-centered">
  79. <a class="link is-info">Reservations</a>
  80. </p>
  81. <p class="level-item has-text-centered">
  82. <a class="link is-info">Contact</a>
  83. </p>
  84. </nav>
  85. {% endcapture %}
  86. {% capture nav_mobile_example %}
  87. <nav class="level is-mobile">
  88. <div class="level-item has-text-centered">
  89. <div>
  90. <p class="heading">Tweets</p>
  91. <p class="title">3,456</p>
  92. </div>
  93. </div>
  94. <div class="level-item has-text-centered">
  95. <div>
  96. <p class="heading">Following</p>
  97. <p class="title">123</p>
  98. </div>
  99. </div>
  100. <div class="level-item has-text-centered">
  101. <div>
  102. <p class="heading">Followers</p>
  103. <p class="title">456K</p>
  104. </div>
  105. </div>
  106. <div class="level-item has-text-centered">
  107. <div>
  108. <p class="heading">Likes</p>
  109. <p class="title">789</p>
  110. </div>
  111. </div>
  112. </nav>
  113. {% endcapture %}
  114. {% include subnav-layout.html %}
  115. <section class="section">
  116. <div class="container">
  117. <h1 class="title">Level</h1>
  118. <h2 class="subtitle">A multi-purpose <strong>horizontal level</strong>, which can contain almost any other element</h2>
  119. <hr>
  120. <div class="content">
  121. <p>The <strong>structure</strong> of a level is the following:</p>
  122. <ul>
  123. <li>
  124. <code>level</code>: main container
  125. <ul>
  126. <li><code>level-left</code> for the left side. This element is <em>required</em>, even if it is empty</li>
  127. <li>
  128. <code>level-right</code> for the right side
  129. <ul>
  130. <li><code>level-item</code> for each individual element</li>
  131. </ul>
  132. </li>
  133. </ul>
  134. </li>
  135. </ul>
  136. <p>In a <code>level-item</code>, you can then insert almost <em>anything</em> you want: a title, a button, a text input, or just simple text. No matter what elements you put inside a Bulma <code>level</code>, they will always be <strong>vertically centered</strong>.</p>
  137. </div>
  138. <div class="bd-structure">
  139. <nav class="level bd-structure-item bd-is-structure-container" title="level">
  140. <div class="level-left bd-structure-item" title="level-left">
  141. <div class="level-item">
  142. <p class="subtitle is-5">
  143. <strong>123</strong> posts
  144. </p>
  145. </div>
  146. <div class="level-item">
  147. <div class="field has-addons">
  148. <p class="control">
  149. <input class="input" type="text" placeholder="Find a post">
  150. </p>
  151. <p class="control">
  152. <button class="button">
  153. Search
  154. </button>
  155. </p>
  156. </div>
  157. </div>
  158. </div>
  159. <div class="level-right bd-structure-item" title="level-right">
  160. <p class="level-item">
  161. <strong>All</strong>
  162. </p>
  163. <p class="level-item">
  164. <a>Published</a>
  165. </p>
  166. <p class="level-item">
  167. <a>Drafts</a>
  168. </p>
  169. <p class="level-item">
  170. <a>Deleted</a>
  171. </p>
  172. <p class="level-item">
  173. <a class="button is-success">
  174. New
  175. </a>
  176. </p>
  177. </div>
  178. </nav>
  179. </div>
  180. <div class="bd-example">
  181. {{nav_example}}
  182. </div>
  183. {% highlight html %}{{nav_example}}{% endhighlight %}
  184. {% include anchor.html name="Centered level" %}
  185. <div class="content">
  186. If you want a <strong>centered level</strong>, you can use as many <code>level-item</code> as you want, as long as they are <strong>direct</strong> children of the <code>level</code> container.
  187. </div>
  188. <div class="bd-example">
  189. {{nav_centered_example}}
  190. </div>
  191. {% highlight html %}{{nav_centered_example}}{% endhighlight %}
  192. <div class="bd-example">
  193. {{nav_centered_bis_example}}
  194. </div>
  195. {% highlight html %}{{nav_centered_bis_example}}{% endhighlight %}
  196. {% include anchor.html name="Mobile level" %}
  197. <div class="content">
  198. By default, for space concerns, the level is vertical on mobile. If you want the level to be horizontal on mobile as well, add the <code>is-mobile</code> modifier on the <code>level</code> container.
  199. </div>
  200. <div class="bd-example">
  201. {{nav_mobile_example}}
  202. </div>
  203. {% highlight html %}{{nav_mobile_example}}{% endhighlight %}
  204. </div>
  205. </section>