Skip to content
v0.9.1
Utilities

Utilities

Small one-job classes for layout and spacing, with the same short names as Moey: flex, gap-4, p-6, w-full. Use them to place components without writing CSS.

How they read

HR
Henry RichardsonProduct designer
<div class="flex items-center justify-between gap-4 p-4 box">
  <div class="flex items-center gap-3">
    <span class="avatar bg-violet">HR</span>
    <div><b class="block">Henry Richardson</b><span class="text-sm text-muted">Product designer</span></div>
  </div>
  <button class="btn btn-sm" type="button">Follow</button>
</div>

Each class does one thing: flex lays children in a row, items-center centers them up and down, justify-between pushes them apart, gap-4 puts 16px between them, p-4 pads the box by 16px.

The spacing scale

Every number is × 4px: p-1 is 4px, p-4 is 16px, gap-6 is 24px, w-12 is 48px. The same scale runs through padding, margin, gap, width and height, so spaces line up across a page. The steps are 0, 0.5, 1, 1.5, 2, 2.5, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, 20 and 24 (sizes go on to 128).

Screen sizes

Classes work on phones first. Put a screen size in front to start a class from that width up: md:flex-row is a row from 768px, lg:grid-cols-3 is three columns from 1024px.

PrefixFromTypical screen
(none)0every screen, phones first
sm:576pxlarge phones
md:768pxtablets
lg:1024pxlaptops
xl:1280pxdesktops
2xl:1536pxbig screens
Stacked on phones
side by side from 768px
(make the window narrow)
<div class="flex flex-col md:flex-row gap-3">
  <div class="box p-4 flex-1">Stacked on phones</div>
  <div class="box p-4 flex-1">side by side from 768px</div>
  <div class="box p-4 flex-1">(make the window narrow)</div>
</div>

Layout, spacing, sizing, text size and alignment, position and overflow all have screen-size versions. Borders, colors, motion and interactions don't: they rarely change with the screen.

Box sizes instead of screen sizes

A card in a sidebar and the same card in the main column have very different room. Mark a box with @container, then @md:flex-row reacts to that box's width, not the screen's. Sizes: @xs 320px, @sm 384px, @md 448px, @lg 512px, @xl 576px, @2xl 672px.

Website redesign12 files · edited today
<div class="@container box p-4">
  <div class="flex flex-col @md:flex-row @md:items-center gap-3">
    <span class="stat-icon-box"><i class="mi mi-folder" aria-hidden="true"></i></span>
    <div class="flex-1"><b class="block">Website redesign</b><span class="text-sm text-muted">12 files · edited today</span></div>
    <button class="btn btn-sm" type="button">Open</button>
  </div>
</div>

Layout essentials have box-size versions: display, direction and wrap, grid columns (1, 2, 3, 4, 6), alignment, gap, padding, text alignment and widths.

Utilities always win

Momo puts its CSS in three layers: foundations, then components, then utilities. A utility beats a component's own style however that style is written, so p-0 on a card body really removes its padding. CSS you write yourself (outside any layer) beats all of Momo, so overriding never needs !important.

All utility pages

Start

OverviewStart Getting startedStart CustomizeStart

Guides

AccessibilityGuides BreakpointsGuides ChangelogGuides Customize componentsGuides JavaScriptGuides MotionGuides OptimizeGuides PhonesGuides RebootGuides Right-to-left (RTL)Guides Stacking orderGuides Using Momo with AIGuides

Foundations

ColorsFoundations TypographyFoundations ProseFoundations Images & figuresFoundations CodeFoundations Lines & shadowsFoundations Dark modeFoundations

Forms

Checkbox & switchForms ComboboxForms Date pickerForms Date rangeForms Fields & labelsForms File uploadForms Floating labelsForms Number stepperForms PasswordForms PIN codeForms RatingForms SelectForms SliderForms Tag inputForms Time pickerForms ValidationForms

Components

AccordionComponents Alert & bannerComponents AvatarComponents BadgeComponents BreadcrumbComponents ButtonComponents Button groupComponents CalendarComponents CardComponents CarouselComponents ChartsComponents ChipsComponents CollapseComponents Command paletteComponents CommentsComponents Confirm dialogsComponents Cookie bannerComponents Data tableComponents Description listComponents Dialog & toastComponents DividerComponents DrawerComponents Dropdown menuComponents Empty stateComponents File managerComponents Filter & sortComponents Gallery & lightboxComponents Inbox & chatComponents Infinite scrollComponents KanbanComponents Keyboard shortcutsComponents List groupComponents MarqueeComponents Media objectComponents Nav overflowComponents Notification centerComponents PaginationComponents ProgressComponents Pull to refreshComponents SkeletonComponents SortableComponents SpinnerComponents Split viewComponents Stat cardComponents Steps & wizardComponents Swipe actionsComponents TableComponents TabsComponents TimelineComponents TogglerComponents Tooltip & popoverComponents TourComponents Tree viewComponents VideoComponents WhiteboardComponents

Layout

Announcement barLayout App shellLayout Back to topLayout Container & sectionLayout ExamplesLayout FooterLayout HeroLayout JumbotronLayout Mega menuLayout NavbarLayout Site sidebarLayout

Sections

Bento gridSections Blog cardsSections Call to actionSections Contact & newsletterSections FAQSections FeaturesSections Logo cloudSections PricingSections TeamSections TestimonialsSections

Utilities

OverviewUtilities State variantsUtilities Display & flexUtilities Grid & gapUtilities SpacingUtilities SizingUtilities TextUtilities Links & color strengthUtilities Position & overflowUtilities BackgroundsUtilities Borders & effectsUtilities Transforms & filtersUtilities InteractionsUtilities

Helpers

Fixed, sticky & frostedHelpers Hover & focusHelpers Hover revealHelpers Icon linkHelpers PrintHelpers Relative timeHelpers Screen reader textHelpers Scroll inHelpers ScrollspyHelpers Share buttonHelpers Skip linkHelpers StacksHelpers Stretched linkHelpers Theme toggleHelpers Truncated textHelpers

Page patterns

404 pagePage patterns Coming soonPage patterns Login & registerPage patterns SettingsPage patterns ProfilePage patterns CRM contactsPage patterns ProjectsPage patterns File manager pagePage patterns Billing & plansPage patterns Help centerPage patterns Mobile app screensPage patterns
↑ ↓ moveEnter openEsc close