level.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. ---
  2. title: Level
  3. layout: documentation
  4. doc-tab: layout
  5. doc-subtab: level
  6. ---
  7. {% capture nav_example %}
  8. <!-- Main container -->
  9. <nav class="level">
  10. <!-- Left side -->
  11. <div class="level-left">
  12. <div class="level-item">
  13. <p class="subtitle is-5">
  14. <strong>123</strong> posts
  15. </p>
  16. </div>
  17. <div class="level-item">
  18. <div class="field has-addons">
  19. <p class="control">
  20. <input class="input" type="text" placeholder="Find a post">
  21. </p>
  22. <p class="control">
  23. <button class="button">
  24. Search
  25. </button>
  26. </p>
  27. </div>
  28. </div>
  29. </div>
  30. <!-- Right side -->
  31. <div class="level-right">
  32. <p class="level-item"><strong>All</strong></p>
  33. <p class="level-item"><a>Published</a></p>
  34. <p class="level-item"><a>Drafts</a></p>
  35. <p class="level-item"><a>Deleted</a></p>
  36. <p class="level-item"><a class="button is-success">New</a></p>
  37. </div>
  38. </nav>
  39. {% endcapture %}
  40. {% capture nav_centered_example %}
  41. <nav class="level">
  42. <div class="level-item has-text-centered">
  43. <div>
  44. <p class="heading">Tweets</p>
  45. <p class="title">3,456</p>
  46. </div>
  47. </div>
  48. <div class="level-item has-text-centered">
  49. <div>
  50. <p class="heading">Following</p>
  51. <p class="title">123</p>
  52. </div>
  53. </div>
  54. <div class="level-item has-text-centered">
  55. <div>
  56. <p class="heading">Followers</p>
  57. <p class="title">456K</p>
  58. </div>
  59. </div>
  60. <div class="level-item has-text-centered">
  61. <div>
  62. <p class="heading">Likes</p>
  63. <p class="title">789</p>
  64. </div>
  65. </div>
  66. </nav>
  67. {% endcapture %}
  68. {% capture nav_centered_bis_example %}
  69. <nav class="level">
  70. <p class="level-item has-text-centered">
  71. <a class="link is-info">Home</a>
  72. </p>
  73. <p class="level-item has-text-centered">
  74. <a class="link is-info">Menu</a>
  75. </p>
  76. <p class="level-item has-text-centered">
  77. <img src="{{ site.url }}/images/bulma-type.png" alt="" style="height: 30px;">
  78. </p>
  79. <p class="level-item has-text-centered">
  80. <a class="link is-info">Reservations</a>
  81. </p>
  82. <p class="level-item has-text-centered">
  83. <a class="link is-info">Contact</a>
  84. </p>
  85. </nav>
  86. {% endcapture %}
  87. {% capture nav_mobile_example %}
  88. <nav class="level is-mobile">
  89. <div class="level-item has-text-centered">
  90. <div>
  91. <p class="heading">Tweets</p>
  92. <p class="title">3,456</p>
  93. </div>
  94. </div>
  95. <div class="level-item has-text-centered">
  96. <div>
  97. <p class="heading">Following</p>
  98. <p class="title">123</p>
  99. </div>
  100. </div>
  101. <div class="level-item has-text-centered">
  102. <div>
  103. <p class="heading">Followers</p>
  104. <p class="title">456K</p>
  105. </div>
  106. </div>
  107. <div class="level-item has-text-centered">
  108. <div>
  109. <p class="heading">Likes</p>
  110. <p class="title">789</p>
  111. </div>
  112. </div>
  113. </nav>
  114. {% endcapture %}
  115. {% include subnav-layout.html %}
  116. <section class="section">
  117. <div class="container">
  118. <h1 class="title">Level</h1>
  119. <h2 class="subtitle">A multi-purpose <strong>horizontal level</strong>, which can contain almost any other element</h2>
  120. <hr>
  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 %}
  193. </div>
  194. </section>