# Media

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2F9BrPQdUszNKlGHne6ILz%2FMedia%20Hero.png?alt=media&#x26;token=e4054890-ee06-42e3-9482-fb702807b83d" alt=""><figcaption><p>Illustration of Media Component</p></figcaption></figure>

## Overview

Use the Media component to add graphics into the interface like image, illustrations, videos, flags, icons or avatars to the interface.

### Size and formats

The component can adapt from very small (siez 5) to extra extra large (size 11) sizes, allowing flexibility in design and layout. In total 7 sizes are available.

The component adjusts its design to adapt for differents formats :&#x20;

* **Square Images:** Fill the entire space.
* **Landscape Images:** Fit to height.
* **Portrait Images:** Fit to width.
* **Custom Sizing:** Media dimensions can be customized with specific max and min widths and heights, ensuring optimal display across devices.

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FsbCeN16rCjOmZ8y1Pxzr%2Fmedia.png?alt=media&#x26;token=2c690309-cd32-46b4-93cf-f72de36af2f8" alt=""><figcaption><p>How various media format are displayed</p></figcaption></figure>

### Technical specifications

Media comes with an empty state, to be used when no media has been provided. It is also used for loading state.&#x20;

Hovering over the media reveals a preview icon. Media is clickable, triggering a Lightbox for preview.

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2F4hh5xeeYDUbNN2Wq8Zqk%2Fhover-media.png?alt=media&#x26;token=4e6727cd-14f1-43d4-a4ee-6a29dd7a0152" alt=""><figcaption><p>Hovering a media</p></figcaption></figure>

### Lightbox <a href="#id-47c1ed" id="id-47c1ed"></a>

Media appears as a thumbnail image, providing a clean and uniform look across the platform. When a user clicks on the thumbnail, the media opens in a dedicated overlay (called a Lightbox). This Lightbox focuses the viewer’s attention by dimming the rest of the website and presenting the media in a larger, central frame. This feature is especially useful for videos but also allows users to view images in a larger format.

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FnIUOa5MDTQWKteZNBxnU%2Flightbox.png?alt=media&#x26;token=b50342eb-74db-4c65-8a5c-6ef05142758d" alt=""><figcaption><p>Lightbox</p></figcaption></figure>

## Avatar  <a href="#id-47c1ed" id="id-47c1ed"></a>

The Avatar component adapts to show users or entities. It can display initials, icons, or images, with the name shown when you hover. Clicking triggers actions.&#x20;

To display multiple avatars, uses component `Avatars` it automatically handles different colors and spacing.&#x20;

Disabled avatars show that the user or entity is no longer active.

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2Fh5WORERfkxWDLOuPd0UG%2Favatar.svg?alt=media&#x26;token=2e1e7bcd-508f-4f73-ad5f-afa3c3f4f894" alt=""><figcaption></figcaption></figure>

## Guidelines <a href="#id-47c1ed" id="id-47c1ed"></a>

### How to use <a href="#id-0645af" id="id-0645af"></a>

* **Enhance content by adding visual representation :** Use Media to add value to the content, aiding in user navigation and comprehension without overwhelming the text content.
* **Media to the second plan :** Media should never dominate the page or replace textual information, it always has to be used as a complementary source of knowlegde.

### How to not use <a href="#id-62e02e" id="id-62e02e"></a>

* **Decorative purpose only:** Do not use Media component if it does not add informational value or if it overly clutters the interface.

## Accessibility <a href="#id-19ec8f" id="id-19ec8f"></a>

* **Screen Reader Support:** All media must have `alt` text for screen readers, enhancing accessibility for visually impaired users. For videos, use video tracks with captions.\
  Avoid repeating information already present on the page visually.
* **Captions and Tracks:** Adding captions to images and providing track support for videos (with captions, subtitles) is crucial for accessibility and compliance with web standards.

## Key takeaways <a href="#id-8864e6" id="id-8864e6"></a>

{% hint style="success" %}

* Context is crucial:  media should add value to the related content.
* Use the right component size considering the whole page design
* Provide descriptive Alt-text for screen readers and captions for all other users
  {% endhint %}

{% hint style="danger" %}

* Use `Media` with no context to it
* Repeat information in your alt text that is already on the page.
  {% endhint %}
