Media

Media objects provide you with a flexible component that can be easily nested and repeated, such as blog comments and tweets.

Example

Media objects are useful for repetitive components that have a media element positioned alongside them, such as an user image or blog post image.

Media Image

Media Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et...

<i-media>
    <template #image>
        <img src="../../../assets/images/placeholder-100x100.jpg" height="80" width="80" alt="Media Image" />
    </template>
    <h3>Media Title</h3>
    <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit,
        sed do eiusmod tempor incididunt ut labore et...
    </p>
</i-media>

Nesting

Media components can be nested inside one another to create a parent-child relationship between related components.

Media Image

Media Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Media Image

Nested Media Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

<i-media>
    <template #image>
        <img src="../../../assets/images/placeholder-100x100.jpg" height="80" width="80" alt="Media Image" />
    </template>
    <h3>Media Title</h3>
    <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    </p>

    <i-media>
        <template #image>
            <img src="../../../assets/images/placeholder-100x100.jpg" height="60" width="60" alt="Media Image" />
        </template>
        <h3>Nested Media Title</h3>
        <p>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
        </p>
    </i-media>
</i-media>

Alignment

The media element in a media component can be aligned with flexbox helper classes to the top (default), middle, or end of the .media-body content.

Media Image

Media Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Media Image

Media Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Media Image

Media Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

<i-media>
    <template #image>
        <img class="_align-self:flex-start" src="../../../assets/images/placeholder-100x100.jpg" height="80" width="80" alt="Media Image" />
    </template>
    <h3>Media Title</h3>
    <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    </p>
</i-media>

<i-media>
    <template #image>
        <img class="_align-self:center" src="../../../assets/images/placeholder-100x100.jpg" height="80" width="80" alt="Media Image" />
    </template>
    <h3>Media Title</h3>
    <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    </p>
</i-media>

<i-media>
    <template #image>
        <img class="_align-self:flex-end" src="../../../assets/images/placeholder-100x100.jpg" height="80" width="80" alt="Media Image" />
    </template>
    <h3>Media Title</h3>
    <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    </p>
</i-media>

Configuration

Slots

Use slots to insert custom content into well-defined component locations.

  • Property
    default
    Description Slot for default media content

CSS Variables

Read more about configuring Inkline’s Design System variables to update the look and feel of the component.

  • Property
    ----image--margin-right
    Valuevar(--margin-right)
    Description The margin right of the media component image