Airframe GitHub Storybook
Component

ba-media-object

Used to show some media and content side by side

Airframe

Active
Figma

Web Components

Active
Storybook GitHub

React

Active
Storybook GitHub

React Native

Planned
Design Code Accessibility QA
A

Media

The icon or image placed in the media slot, positioned to the left of the content

B

Content

The title and paragraph text placed in the content slot, aligned alongside the media

<ba-media-object>
  <ba-icon name="paper-plane" slot="media"></ba-icon>
  <ba-content>
    <p>Anim excepteur aliqua excepteur ullamco ullamco voluptate laboris commodo nisi veniam aliquip ut.</p>
  </ba-content>
</ba-media-object>
Property Attribute Description Type Default
alignMediaTo align-media-to Allows setting the media slot to match the height of the first line of text in the content slot.
This is useful for aligning media with text in the content slot.
"body" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "heading-micro-xs" | "heading-micro-xxs" | "heading-primary" | "heading-secondary" | "heading-tertiary" | "p" | "small-print" | "summary" | undefined undefined
gutter gutter Set's the gutter between the media slot and the content "16" | "24" | "32" | "40" | "48" | "8" | undefined '16'
  • None
Slot Description Permitted elements
Unnamed slot Elements will render in the body of the component <ba‑content>, <ba‑flex>, <ba‑grid>
"media" Elements will render in the body of the component <ba‑icon>, <ba‑image>, <ba‑logo>, <div>, <svg>

ba-media-object can be slotted into:

Basic example using an icon and some content
<ba-media-object>
  <ba-icon name="paper-plane" slot="media"></ba-icon>
  <ba-content>
    Anim excepteur aliqua excepteur ullamco ullamco voluptate laboris commodo nisi veniam aliquip ut.
  </ba-content>
</ba-media-object>
Basic example using an icon and aligning it to the first line of content
<ba-media-object align-media-to="h4">
  <ba-icon name="paper-plane" slot="media" size="16"></ba-icon>
  <ba-content>
    <h4>Anim excepteur aliqua excepteur ullamco ullamco voluptate laboris commodo nisi veniam aliquip ut.</h4>
  </ba-content>
</ba-media-object>

When using ba-media-object with ba-image a width must be set on the ba-image component using css, otherwise the image will not show. This prevents layout shifts when the browser loads the image.

An example of ba-media-object being used with an image in the media block
<ba-media-object>
  <ba-image
    class="your-media-object-image-class"
    slot="media"
    alt="Description of image"
    src="https://www.britishairways.com/assets/images/MediaHub/Media-Database/Royalty-free-RF/Destinations/USA/Florida/Orlando-MCO/524927017_1920x1080.jpg"
    aspect-ratio="16-9"
  ></ba-image>
  <ba-content>
    Anim excepteur aliqua excepteur ullamco ullamco voluptate laboris commodo nisi veniam aliquip ut.
  </ba-content>
</ba-media-object>
Prop Description Type Default
alignMediaTo Allows setting the media slot to match the height of the first line of text in the content slot.
This is useful for aligning media with text in the content slot.
"body" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "heading-micro-xs" | "heading-micro-xxs" | "heading-primary" | "heading-secondary" | "heading-tertiary" | "p" | "small-print" | "summary" | undefined undefined
gutter Set's the gutter between the media slot and the content "16" | "24" | "32" | "40" | "48" | "8" | undefined '16'
children Elements will render in the body of the component <ba‑content>, <ba‑flex>, <ba‑grid>
media Elements will render in the body of the component <ba‑icon>, <ba‑image>, <ba‑logo>, <div>, <svg>

None

BaMediaObject can be slotted into:

Basic example using an icon and some content
<BaMediaObject
  media={<ba-icon name="paper-plane" size="16"></ba-icon>}
>
  <BaContent>
    Anim excepteur aliqua excepteur ullamco ullamco voluptate laboris commodo nisi veniam aliquip ut.
  </BaContent>
</BaMediaObject>
Basic example using an icon and aligning it to the first line of content
<BaMediaObject alignMediaTo="h4"
  media={<ba-icon name="paper-plane" size="16"></ba-icon>}
>
  <BaContent>
    <h4>Anim excepteur aliqua excepteur ullamco ullamco voluptate laboris commodo nisi veniam aliquip ut.</h4>
  </BaContent>
</BaMediaObject>

When using ba-media-object with ba-image a width must be set on the ba-image component using css, otherwise the image will not show. This prevents layout shifts when the browser loads the image.

An example of ba-media-object being used with an image in the media block
<BaMediaObject
  media={<BaImage
    className="your-media-object-image-class"
    alt="Description of image"
    src="https://www.britishairways.com/assets/images/MediaHub/Media-Database/Royalty-free-RF/Destinations/USA/Florida/Orlando-MCO/524927017_1920x1080.jpg"
    aspectRatio="16-9"
  />}
>
  <BaContent>
    Anim excepteur aliqua excepteur ullamco ullamco voluptate laboris commodo nisi veniam aliquip ut.
  </BaContent>
</BaMediaObject>

React Native documentation coming soon.

State: ba-media-object is a non-interactive container

⇥ Tab

Focus moves through interactive elements within the media and content slots, skipping ba-media-object itself

Use this checklist to confirm the component has been configured and used correctly.

  • ba-media-object is used to show some media (such as an icon or image) and content side by side
  • When ba-image is used in the media slot, a width is explicitly set on it so it shows within ba-media-object
  • The align-media-to attribute is used to align the media with a specific line of content, such as a heading, where needed
  • Media such as icons or images has appropriate alternative text, or is marked as decorative where it adds no information
  • Heading levels used within the content slot follow a logical hierarchy and don't skip levels

These checks are handled by the component and do not need to be repeated each time it is used.

  • ba-media-object is operable using assistive technology
  • Has a visible focus indicator on all sides of the component
  • Colour contrast for all states in all BAgel themes
  • Animations respect users' reduced motion settings
  • High contrast mode adjustments
Designing Developing Components BAgel helper Web QA React Native QA britishairways.com Careers Cookie policy