Breakpoints
The screen widths at which layouts change. Momo starts from the phone and adds to it as the screen gets wider, and many parts follow the room they have, not the screen.
The five widths
| Name | From | Think of | In a class |
|---|---|---|---|
| (none) | 0 | Phones | flex |
sm | 576px | Big phones, small tablets | sm:flex |
md | 768px | Tablets | md:flex |
lg | 1024px | Laptops | lg:flex |
xl | 1280px | Desktops | xl:flex |
2xl | 1536px | Wide desktops | 2xl:flex |
A class without a name applies everywhere. A class with a name applies from that width up. So you write the phone layout first and then say what changes.
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3" id="bp-grid">
<div class="box p-4 bg-yellow-soft">One</div>
<div class="box p-4 bg-pink-soft">Two</div>
<div class="box p-4 bg-cyan-soft">Three</div>
<div class="box p-4 bg-lime-soft">Four</div>
</div><!-- one column on phones, two from 576px, four from 1024px -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3">…</div>Layout, spacing, sizing, text size and alignment, position and overflow have these screen-size versions. Colors, borders and motion do not: they rarely change with the screen. The full list is on Utilities.
The room a box has
A card in a sidebar and the same card in the main column have very different room. Mark a box with @container, and the @ classes inside it follow that box's width.
| Name | Box is at least | In a class |
|---|---|---|
@xs | 320px | @xs:flex-row |
@sm | 384px | @sm:flex-row |
@md | 448px | @md:flex-row |
@lg | 512px | @lg:flex-row |
@xl | 576px | @xl:flex-row |
@2xl | 672px | @2xl:flex-row |
What the components do
- Most components need nothing: card grids, features, pricing and form grids fit as many columns as there is room for.
- Phone-only changes happen under 576px: pop-ups become bottom sheets, description lists and horizontal forms stack, toasts span the width. See Phones.
- The split view, the inbox, the nav overflow and the call to action measure themselves, so they also fold inside a narrow column on a big screen.
- The navbar and the app shell move their links into a drawer on small screens.
In your own CSS
Use the same numbers, written as a range. Momo's own phone rules stop just under 576px.
@media (width >= 768px) { .my-sidebar { display: block; } } /* md and up */
@media (max-width: 575.98px) { .my-toolbar { flex-wrap: wrap; } } /* phones only */