# Panel

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2Fe3vmtyMdA4gV920q2Uve%2FPanel%20Hero.png?alt=media&#x26;token=0c30fae2-4435-4d9f-8c25-1875383d9355" alt=""><figcaption></figcaption></figure>

## Overview

To make sure all designers on all projects build views consistently, it is important that we use Roma layout components. By doing so, we ensure the consistency, sustainability, and scalability of our designs, and we facilitate the onboarding of new designers into the team.

Panels can be composed of the following components that can only be children of the main panel.

* [Panel Header](#panel-header)
* [Panel Content](#panel-content)
  * [SubContentWrapper](#subcontentwrapper)
* [Panel Link](#panel-link)
* [Panel Separator](#panel-separator)
* [Panel Tabs](#panel-tabs)
* [Panel Footer](#panel-footer)

You cannot nest these elements inside each other; if you want a panel separator, you have to place it within the main panel, not the panel content component.

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FYc63a3LNIH8OMlCnNM1p%2FPanel%20Zoning.png?alt=media&#x26;token=c00b16e9-282b-4fe2-b895-37ec2c3df72b" alt=""><figcaption></figcaption></figure>

## Guidelines

### Panel header

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FFMyvHSkXHQ1fnVgZW6Tb%2FPanel%20Header.png?alt=media&#x26;token=e4d8931c-386f-4673-b702-ba65a85c04f2" alt=""><figcaption></figcaption></figure>

As its name states, Panel Header is the first element that appears within the panel structure. It is not mandatory but highly recommended. As an example, if the [Page Title](https://design.mirakl.com/design/components/navigation/page-title) is clear enough, you may remove it.

{% hint style="info" %}
For accessibility reasons, if there is no `Panel Header` in the `Panel`, you should specify an `<aria-label>`(to be added in the code). It will not be visible in the interface but it will help screen readers to read the page while reassuring users who are navigating it.
{% endhint %}

Panel Header has several options, such as [Button group](https://design.mirakl.com/design/components/actions/button-group), [Background Icon](https://design.mirakl.com/design/components/structure/broken-reference), and [Badges](https://design.mirakl.com/design/components/feedback/badge-status) (2 maximum).

### Panel content

Panel Content is used to contain anything that has to go inside a panel (text, image, datatable, datalist, etc.).&#x20;

Panel has 3 options:

* Classic
* Expandable : its content is hidden until user triggers it to reveal content.
* Scrollable : user can navigate content by scrolling it

{% tabs %}
{% tab title="Expandable" %}
This layout helps declutter a page and hide information that might not be useful at first to users. You can choose to expand or collapse it by default.

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FqWJh3VVdO4noChAFL875%2Fpanel-expandable.gif?alt=media&#x26;token=15b3ad20-29aa-405c-ae7c-2ccf3b93e253" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Scrollable" %}
This layout allows putting long-form content within a panel in which the user can scroll. You can define a max height.

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2Fii25LGWslLWi9kGqx9MA%2Fpanel-scrollable.gif?alt=media&#x26;token=b6f22815-b932-487a-9dd8-ad71dd52f723" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

All elements contained within a panel are separated by a 16px margin in all directions, as follows:

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FEAM2Rim5SFfk3jzmbmAY%2FPanel16px.svg?alt=media&#x26;token=85a19c3e-ee7f-4c70-958e-57463a460287" alt=""><figcaption></figcaption></figure>

#### SubContentWrapper

***SubContentWrapper*** is a structural container used exclusively within Panel Content to express visual hierarchy and dependency between content blocks. It adds a semi-transparent vertical indentation bar and consistent spacing to communicate "this section belongs to the preceding element."

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FpnCmDoTkyxs4pUlwuFBJ%2FMirakl%20Roma%20-%20SubContentWrapper.png?alt=media&#x26;token=62ac788d-b38d-4a46-ba76-a03c22e1680e" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
**When to use**

* To visually group content that is structurally dependent on a parent element (checkbox, radio, select, or toggle)
* When the nested content represents a sub-element or sub-configuration of its trigger, not merely a conditional choice
* To maintain clear visual hierarchy within complex panel layouts
  {% endhint %}

{% hint style="danger" %}
**When not to use**

* For generic spacing or indentation without a true dependency relationship
* To reveal content that only depends on a form choice but is not a sub-element of that choice (use standard [progressive disclosure](https://design.mirakl.com/design/patterns/progressive-disclosure) instead)
* Key distinction: SubContentWrapper is for parent-child relationships (e.g., "Configure shipping method" → "Express shipping options"), not simple conditional visibility (e.g., "Enable notifications" → "Email address field"). If the revealed content is a peer requirement rather than a nested configuration, do not use SubContentWrapper.
  {% endhint %}

**Options**

Collapsible: Can expand/collapse when controlled by an external trigger (button, checkbox, toggle). The wrapper itself is non-interactive; state is managed by the controlling element using aria-expanded and aria-controls.\
Spacing: Bottom spacing can be removed when multiple wrappers are stacked consecutively.\
Nesting: Supports up to 2 levels maximum. Keep nesting shallow to avoid overwhelming users.

**Accessibility**

* The wrapper is purely presentational (no role, no form behavior)
* When collapsible, the controlling element must be focusable and reflect state with aria-expanded
* Use aria-controls to connect the trigger to the wrapper region by ID
* Ensure keyboard users can reach all interactive elements within the wrapper when expanded

**Relationship to Progressive Disclosure**

SubContentWrapper pairs naturally with the [Progressive Disclosure pattern](https://design.mirakl.com/design/patterns/progressive-disclosure). When content is conditionally revealed based on a prior choice, wrap it in a SubContentWrapper only if it represents a sub-element or nested configuration of the trigger. Place the wrapper immediately after its controlling element to keep the cause → effect relationship obvious. For simple conditional visibility without hierarchical dependency, use standard progressive disclosure techniques without SubContentWrapper.

### Panel link

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FFjNMyePU0tjRfcw334XI%2FPanel%20link.png?alt=media&#x26;token=65da9b54-32bc-47be-8ba7-f6a98bcfed19" alt=""><figcaption></figcaption></figure>

Panel link creates a vertical visual narrative between different panel elements. You may also add text within the link.

### Panel separator

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FhSlmZ2X3dblecbqaOrLv%2FPanel%20separator.png?alt=media&#x26;token=8346675e-6a9f-4333-b920-1bf890c47aad" alt=""><figcaption></figcaption></figure>

Panel Separator can help you structure your panel visually and make a difference between 2 panel content components. It is never mandatory.

Two options are available: classic and full-width. You may also add text within the separator.

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FsbBceK8yhLC2y5xRNynH%2FPanel%20separator%20with%20text.png?alt=media&#x26;token=d24cdf47-284f-4f6f-abe7-467c07f53230" alt="" width="563"><figcaption></figcaption></figure>

### Panel footer

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FOuOsOjowIQAWFdg8swGX%2FPanel%20footer.png?alt=media&#x26;token=6a98a010-76b4-43da-8a3a-cf7309142a21" alt=""><figcaption></figcaption></figure>

Panel footer is really useful when you wish to display a fixed element after a Panel Content, especially a scrollable one.
