bulma/docs/documentation/layout/media-object.html

211 lines
6.0 KiB
HTML
Raw Normal View History

2017-08-30 16:44:44 +00:00
---
title: Media Object
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: media-object
2018-04-09 15:50:33 +00:00
breadcrumb:
2024-03-21 16:11:54 +00:00
- home
- documentation
- layout
- layout-media
meta:
variables: true
2017-08-30 16:44:44 +00:00
---
{% capture media_example %}
<article class="media">
<figure class="media-left">
<p class="image is-64x64">
2024-03-21 16:11:54 +00:00
<img src="{{site.url}}/assets/images/placeholders/128x128.png" />
2017-08-30 16:44:44 +00:00
</p>
</figure>
<div class="media-content">
<div class="content">
<p>
<strong>John Smith</strong> <small>@johnsmith</small> <small>31m</small>
2024-03-21 16:11:54 +00:00
<br />
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare
magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa
sem. Etiam finibus odio quis feugiat facilisis.
2017-08-30 16:44:44 +00:00
</p>
</div>
<nav class="level is-mobile">
<div class="level-left">
<a class="level-item">
2018-01-10 16:30:23 +00:00
<span class="icon is-small"><i class="fas fa-reply"></i></span>
2017-08-30 16:44:44 +00:00
</a>
<a class="level-item">
2018-01-10 16:30:23 +00:00
<span class="icon is-small"><i class="fas fa-retweet"></i></span>
2017-08-30 16:44:44 +00:00
</a>
<a class="level-item">
2018-01-10 16:30:23 +00:00
<span class="icon is-small"><i class="fas fa-heart"></i></span>
2017-08-30 16:44:44 +00:00
</a>
</div>
</nav>
</div>
<div class="media-right">
<button class="delete"></button>
</div>
</article>
{% endcapture %}
{% capture media_bis_example %}
<article class="media">
<figure class="media-left">
<p class="image is-64x64">
2024-03-21 16:11:54 +00:00
<img src="{{site.url}}/assets/images/placeholders/128x128.png" />
2017-08-30 16:44:44 +00:00
</p>
</figure>
<div class="media-content">
<div class="field">
<p class="control">
<textarea class="textarea" placeholder="Add a comment..."></textarea>
</p>
</div>
<nav class="level">
<div class="level-left">
<div class="level-item">
<a class="button is-info">Submit</a>
</div>
</div>
<div class="level-right">
<div class="level-item">
<label class="checkbox">
2024-03-21 16:11:54 +00:00
<input type="checkbox" /> Press enter to submit
2017-08-30 16:44:44 +00:00
</label>
</div>
</div>
</nav>
</div>
</article>
{% endcapture %}
{% capture media_nested_example %}
<article class="media">
<figure class="media-left">
<p class="image is-64x64">
2024-03-21 16:11:54 +00:00
<img src="{{site.url}}/assets/images/placeholders/128x128.png" />
2017-08-30 16:44:44 +00:00
</p>
</figure>
<div class="media-content">
<div class="content">
<p>
<strong>Barbara Middleton</strong>
2024-03-21 16:11:54 +00:00
<br />
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis porta eros
lacus, nec ultricies elit blandit non. Suspendisse pellentesque mauris
sit amet dolor blandit rutrum. Nunc in tempus turpis.
<br />
2017-08-30 16:44:44 +00:00
<small><a>Like</a> · <a>Reply</a> · 3 hrs</small>
</p>
</div>
<article class="media">
<figure class="media-left">
<p class="image is-48x48">
2024-03-21 16:11:54 +00:00
<img src="{{site.url}}/assets/images/placeholders/96x96.png" />
2017-08-30 16:44:44 +00:00
</p>
</figure>
<div class="media-content">
<div class="content">
<p>
<strong>Sean Brown</strong>
2024-03-21 16:11:54 +00:00
<br />
Donec sollicitudin urna eget eros malesuada sagittis. Pellentesque
habitant morbi tristique senectus et netus et malesuada fames ac
turpis egestas. Aliquam blandit nisl a nulla sagittis, a lobortis
leo feugiat.
<br />
2017-08-30 16:44:44 +00:00
<small><a>Like</a> · <a>Reply</a> · 2 hrs</small>
</p>
</div>
<article class="media">
2024-03-21 16:11:54 +00:00
Vivamus quis semper metus, non tincidunt dolor. Vivamus in mi eu lorem
cursus ullamcorper sit amet nec massa.
2017-08-30 16:44:44 +00:00
</article>
<article class="media">
2024-03-21 16:11:54 +00:00
Morbi vitae diam et purus tincidunt porttitor vel vitae augue.
Praesent malesuada metus sed pharetra euismod. Cras tellus odio,
tincidunt iaculis diam non, porta aliquet tortor.
2017-08-30 16:44:44 +00:00
</article>
</div>
</article>
<article class="media">
<figure class="media-left">
<p class="image is-48x48">
2024-03-21 16:11:54 +00:00
<img src="{{site.url}}/assets/images/placeholders/96x96.png" />
2017-08-30 16:44:44 +00:00
</p>
</figure>
<div class="media-content">
<div class="content">
<p>
<strong>Kayli Eunice </strong>
2024-03-21 16:11:54 +00:00
<br />
Sed convallis scelerisque mauris, non pulvinar nunc mattis vel.
Maecenas varius felis sit amet magna vestibulum euismod malesuada
cursus libero. Vestibulum ante ipsum primis in faucibus orci luctus
et ultrices posuere cubilia Curae; Phasellus lacinia non nisl id
feugiat.
<br />
2017-08-30 16:44:44 +00:00
<small><a>Like</a> · <a>Reply</a> · 2 hrs</small>
</p>
</div>
</div>
</article>
</div>
</article>
2017-08-30 16:44:44 +00:00
<article class="media">
<figure class="media-left">
<p class="image is-64x64">
2024-03-21 16:11:54 +00:00
<img src="{{site.url}}/assets/images/placeholders/128x128.png" />
2017-08-30 16:44:44 +00:00
</p>
</figure>
<div class="media-content">
<div class="field">
<p class="control">
<textarea class="textarea" placeholder="Add a comment..."></textarea>
</p>
</div>
<div class="field">
<p class="control">
<button class="button">Post comment</button>
</p>
</div>
</div>
</article>
{% endcapture %}
2018-04-09 15:33:44 +00:00
<div class="content">
2024-03-21 16:11:54 +00:00
<p>
The
<a
href="http://www.stubbornella.org/content/2010/06/25/the-media-object-saves-hundreds-of-lines-of-code"
>media object</a
>
is a UI element perfect for repeatable and nestable content.
</p>
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=media_example more=true %}
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
<p>
You can include <em>any</em> other Bulma element, like inputs, textareas, icons, buttons… or even a
<strong>navbar</strong>.
</p>
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=media_bis_example more=true %}
{% include docs/elements/anchor.html name="Nesting" %}
2017-08-30 16:44:44 +00:00
2018-04-09 15:33:44 +00:00
<div class="content">
<p>You can nest media objects up to <strong>3 levels</strong> deep.</p>
</div>
2024-03-21 16:11:54 +00:00
{%
include docs/elements/snippet.html content=media_nested_example
horizontal=true more=true
%}