level.html 6.3 KB

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