bulma/docs/documentation/layout/level.html

180 lines
4.6 KiB
HTML
Raw Normal View History

2017-08-30 16:44:44 +00:00
---
title: Level
2024-03-21 16:11:54 +00:00
layout: docs
theme: library
2017-08-30 16:44:44 +00:00
doc-tab: layout
doc-subtab: level
2018-04-09 15:50:33 +00:00
breadcrumb:
2024-03-21 16:11:54 +00:00
- home
- documentation
- layout
- layout-level
meta:
variables: true
hide_css_vars: true
2017-08-30 16:44:44 +00:00
---
{% capture nav_example %}
<!-- Main container -->
<nav class="level">
<!-- Left side -->
<div class="level-left">
<div class="level-item">
2024-03-21 16:11:54 +00:00
<p class="subtitle is-5"><strong>123</strong> posts</p>
2017-08-30 16:44:44 +00:00
</div>
<div class="level-item">
<div class="field has-addons">
<p class="control">
2024-03-21 16:11:54 +00:00
<input class="input" type="text" placeholder="Find a post" />
2017-08-30 16:44:44 +00:00
</p>
<p class="control">
2024-03-21 16:11:54 +00:00
<button class="button">Search</button>
2017-08-30 16:44:44 +00:00
</p>
</div>
</div>
</div>
<!-- Right side -->
<div class="level-right">
<p class="level-item"><strong>All</strong></p>
<p class="level-item"><a>Published</a></p>
<p class="level-item"><a>Drafts</a></p>
<p class="level-item"><a>Deleted</a></p>
<p class="level-item"><a class="button is-success">New</a></p>
</div>
</nav>
{% endcapture %}
{% capture nav_centered_example %}
<nav class="level">
<div class="level-item has-text-centered">
<div>
<p class="heading">Tweets</p>
<p class="title">3,456</p>
</div>
</div>
<div class="level-item has-text-centered">
<div>
<p class="heading">Following</p>
<p class="title">123</p>
</div>
</div>
<div class="level-item has-text-centered">
<div>
<p class="heading">Followers</p>
<p class="title">456K</p>
</div>
</div>
<div class="level-item has-text-centered">
<div>
<p class="heading">Likes</p>
<p class="title">789</p>
</div>
</div>
</nav>
{% endcapture %}
{% capture nav_centered_bis_example %}
<nav class="level">
<p class="level-item has-text-centered">
<a class="link is-info">Home</a>
</p>
<p class="level-item has-text-centered">
<a class="link is-info">Menu</a>
</p>
<p class="level-item has-text-centered">
2024-03-21 16:11:54 +00:00
<img
src="{{ site.url }}/assets/images/bulma-type.png"
alt=""
style="height: 30px"
/>
2017-08-30 16:44:44 +00:00
</p>
<p class="level-item has-text-centered">
<a class="link is-info">Reservations</a>
</p>
<p class="level-item has-text-centered">
<a class="link is-info">Contact</a>
</p>
</nav>
{% endcapture %}
{% capture nav_mobile_example %}
<nav class="level is-mobile">
<div class="level-item has-text-centered">
<div>
<p class="heading">Tweets</p>
<p class="title">3,456</p>
</div>
</div>
<div class="level-item has-text-centered">
<div>
<p class="heading">Following</p>
<p class="title">123</p>
</div>
</div>
<div class="level-item has-text-centered">
<div>
<p class="heading">Followers</p>
<p class="title">456K</p>
</div>
</div>
<div class="level-item has-text-centered">
<div>
<p class="heading">Likes</p>
<p class="title">789</p>
</div>
</div>
</nav>
{% endcapture %}
2018-04-09 15:33:44 +00:00
<div class="content">
<p>The <strong>structure</strong> of a level is the following:</p>
<ul>
<li>
<code>level</code>: main container
2017-08-30 16:44:44 +00:00
<ul>
2024-03-21 16:11:54 +00:00
<li><code>level-left</code> for the left side</li>
2017-08-30 16:44:44 +00:00
<li>
2018-04-09 15:33:44 +00:00
<code>level-right</code> for the right side
2017-08-30 16:44:44 +00:00
<ul>
2018-04-09 15:33:44 +00:00
<li><code>level-item</code> for each individual element</li>
2017-08-30 16:44:44 +00:00
</ul>
</li>
</ul>
2018-04-09 15:33:44 +00:00
</li>
</ul>
2024-03-21 16:11:54 +00:00
<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>
2018-04-09 15:33:44 +00:00
</div>
2024-03-21 16:11:54 +00:00
{%
include docs/elements/snippet.html content=nav_example horizontal=true
more=true
%}
{% include docs/elements/anchor.html name="Centered level" %}
2017-08-30 16:44:44 +00:00
2018-04-09 15:33:44 +00:00
<div class="content">
2024-03-21 16:11:54 +00:00
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.
2018-04-09 15:33:44 +00:00
</div>
2017-08-30 16:44:44 +00:00
2024-03-21 16:11:54 +00:00
{%
include docs/elements/snippet.html content=nav_centered_example
horizontal=true more=true
%}
{%
include docs/elements/snippet.html
content=nav_centered_bis_example horizontal=true more=true
%}
{% include docs/elements/anchor.html name="Mobile level" %}
2017-08-30 16:44:44 +00:00
2018-04-09 15:33:44 +00:00
<div class="content">
2024-03-21 16:11:54 +00:00
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.
2018-04-09 15:33:44 +00:00
</div>
2017-08-30 16:44:44 +00:00
2024-03-21 16:11:54 +00:00
{%
include docs/elements/snippet.html content=nav_mobile_example horizontal=true
more=true
%}