media-object

July 8, 2026 ยท View on GitHub

When To Use

Use this pattern when you need to align media and descriptive content as a stable pair.

HTML

<article class="media_object">
    <figure class="media_object_media"><img alt="Speaker portrait"></figure>
    <div class="media_object_content">
        <h2>Design systems briefing</h2>
        <p>Speaker details align beside the portrait without squeezing the text.</p>
    </div>
</article>

CSS

.media_object {
    align-items: start;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.media_object_media {
    flex-basis: 6rem;
    flex-grow: 0;
}

.media_object_content {
    flex-basis: min(20rem, 100%);
    flex-grow: 1;
    min-inline-size: 0;
}

Core Properties

  • align-items, display, flex-wrap, gap, flex-basis, flex-grow, min-inline-size define the spatial behavior for this pattern.

Properties That Break The Layout If Removed

  • Removing align-items, display, flex-wrap, gap, flex-basis, flex-grow, min-inline-size changes the pattern from its documented layout responsibility back toward ordinary flow or an unsafe fixed arrangement.

Constraints And Change Points

  • reflow responsiveness is part of the contract; change sizing values only when the new minimum, maximum, or wrap point is documented with the pattern.
  • Keep the HTML class hooks and CSS selectors in one-to-one agreement.

Scroll Ownership

No internal scroll container.

Accessibility And Source Order Notes

  • Semantic role expectation: Preserve the HTML sample's landmark, list, navigation, form, figure, or article roles; layout classes must not replace semantic elements.
  • DOM order expectation: Keep semantic elements, DOM order, reading order, and focus order independent from the visual placement created by the layout classes.
  • Focus risk: Any interactive descendants follow DOM order; do not use this pattern to create a visual order that keyboard focus cannot follow.
  • Scroll expectation: No internal scroll container.
  • Cognitive risk: Medium: reflow can change spatial adjacency, so labels, controls, and related content must remain adjacent in DOM order.

Browser And Fallback Notes

The CSS uses modern grid, flex, intrinsic sizing, logical properties, or positioning. If a target browser cannot support a property, fall back to ordinary block flow before adding decorative or script-driven layout behavior.

Composition Notes

Use media_object as the stable pattern root and compose additional layout behavior outside that root unless the child class is part of the documented relationship.

Anti-patterns

  • Do not add color, border, shadow, typography, or animation rules to reusable pattern CSS.
  • Do not use this pattern to repair unclear HTML structure; make the DOM roles legible first.

IA Navigation

Parent: Split / Sidebar patterns in Pattern Categories. Next: Layout Recipes for screen-level composition, or return to the Layout Pattern Catalog when choosing another primitive.