Bootstrap 5 – Layout & Grid System
Estimated reading: 4 minutes 13 views

🧩 Bootstrap 5 – Grid XLarge (xl) Variants – Layouts for Wide Screens

🧲 Introduction – What Is the xl Grid in Bootstrap 5?

In Bootstrap 5, the xl grid breakpoint applies to screens ≥1200px, typically large desktops, wide monitors, or landscape tablets. Using .col-xl-*, .offset-xl-*, and .order-xl-*, you can design layouts that specifically target extra-large displays—great for modern UIs with wide content panels or dashboards.

🎯 In this guide, you’ll learn:

  • How and when to use .col-xl-* classes
  • Full layout examples for extra-large screens
  • Stacking, offsetting, and reordering techniques
  • Tips for using xl in responsive design flows

📐 Bootstrap 5 xl Breakpoint Overview

BreakpointPrefixMin WidthDevices Targeted
XLargexl≥1200pxHD desktops, wide monitors

The xl grid is useful when you want layouts to change on larger-than-average desktop screens, beyond the lg breakpoint (992px).


✅ Example 1 – Two Columns on XLarge Only

<div class="row">
  <div class="col-12 col-xl-6 bg-light p-3">Column Left</div>
  <div class="col-12 col-xl-6 bg-dark text-white p-3">Column Right</div>
</div>

🔍 Output:

  • Stacks on mobile, tablets, and standard desktops
  • Splits into two columns only at ≥1200px

✅ Example 2 – Four Equal Columns at XLarge

<div class="row">
  <div class="col-12 col-xl-3 bg-primary text-white p-3">Col 1</div>
  <div class="col-12 col-xl-3 bg-secondary text-white p-3">Col 2</div>
  <div class="col-12 col-xl-3 bg-success text-white p-3">Col 3</div>
  <div class="col-12 col-xl-3 bg-warning p-3">Col 4</div>
</div>

🔍 Output:

  • Stacked on mobile/tablet
  • Becomes a 4-column layout on large desktops and beyond

✅ Example 3 – Centered Card with offset-xl-*

<div class="row">
  <div class="col-xl-6 offset-xl-3 bg-info text-white text-center p-4">Centered at XL</div>
</div>

🔍 Explanation:

  • Centered block using 6/12 width and offset of 3
  • Only applies from xl screens and up

✅ Example 4 – Reordering Elements at XLarge Screens

<div class="row">
  <div class="col-xl-4 order-xl-3 bg-light p-3">Third</div>
  <div class="col-xl-4 order-xl-1 bg-dark text-white p-3">First</div>
  <div class="col-xl-4 order-xl-2 bg-success text-white p-3">Second</div>
</div>

🔍 Explanation:

  • Visual order is reshuffled only at ≥1200px
  • Helpful for dashboard layouts or featured content rows

✅ Example 5 – Nested Columns in XLarge Grids

<div class="row">
  <div class="col-xl-8 bg-warning p-3">
    <div class="row">
      <div class="col-6 bg-light p-2">Nested A</div>
      <div class="col-6 bg-secondary text-white p-2">Nested B</div>
    </div>
  </div>
  <div class="col-xl-4 bg-info text-white p-3">Sidebar</div>
</div>

🔍 Output:

  • Two nested items on the left (inside 8/12 width)
  • One sidebar column (4/12) on the right at xl and above

🛠️ Best Practices for XLarge (xl) Layouts

TipBenefit
Use col-12 + col-xl-* comboKeeps layouts mobile-first and desktop-ready
Apply .offset-xl-* for centeringClean visual centering for wide screens
Combine with col-lg-*, col-md-*Maintains step-wise control at every level
Avoid overloading wide screensUse white space wisely to improve UX
Use nesting for data-rich areasHelps organize complex layouts within grids

📌 Summary – Grid Variants for Extra-Large Screens

The xl grid variant in Bootstrap 5 ensures you’re fully utilizing screen real estate on wide desktops and monitors. This lets you scale content gracefully while maintaining a mobile-first architecture.

🔍 Key Takeaways:

  • xl kicks in at ≥1200px (HD screens and larger)
  • Use .col-xl-* to control layout structure on large displays
  • Combine with offset/order utilities for precision layout
  • Pair with nesting to manage complex UIs like dashboards

⚙️ Ideal for wide-screen dashboards, multi-panel layouts, reports, and enterprise UIs.


❓ FAQs – Bootstrap 5 XLarge Grid (xl) Variants

What devices does xl target in Bootstrap 5?
✅ Devices with widths of 1200px and above, like widescreen monitors or large desktop setups.


Can I skip lg and go straight to xl in layout classes?
✅ Yes. Use .col-xl-* directly if you only want changes from 1200px and up.


Does xl override smaller grid classes?
✅ Yes. If you define both col-lg-* and col-xl-*, the larger class takes over from ≥1200px.


How do I center content using the xl variant?
✅ Use .offset-xl-* to create balanced spacing and center columns visually.


Share Now :

Leave a Reply

Your email address will not be published. Required fields are marked *

Share

Bootstrap 5 – Grid Variants XLarge

Or Copy Link

CONTENTS
Scroll to Top