level.html 5.6 KB

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