Skip to content
v0.9.1
Utilities

Position & overflow

Pin things (sticky top-0), place them on a corner (absolute top-2 end-2), stack them (z-10), and decide what happens when content doesn't fit.

On a corner

New Team plan Up to 20 people
<div class="relative box p-6 max-w-sm">
  <span class="badge badge-yellow absolute top-2 end-2">New</span>
  <b class="block">Team plan</b>
  <span class="text-sm text-muted">Up to 20 people</span>
</div>

Stuck while scrolling

sticky top-0

Scroll this box: the header stays at the top.

Monday: planning

Tuesday: design review

Wednesday: build

Thursday: test

Friday: ship

<div class="box h-48 overflow-y-auto p-0">
  <div class="sticky top-0 bg-surface border-b px-4 py-2 font-semibold z-10">sticky top-0</div>
  <div class="p-4 space-y-3 text-sm">
    <p>Scroll this box: the header stays at the top.</p><p>Monday: planning</p><p>Tuesday: design review</p><p>Wednesday: build</p><p>Thursday: test</p><p>Friday: ship</p>
  </div>
</div>

Pictures in a fixed shape

aspect-video keeps 16:9, object-cover fills the shape without stretching.

aspect-video
aspect-square
<div class="aspect-video w-64 bg-cyan rounded-lg grid place-items-center">aspect-video</div>
<div class="aspect-square w-32 bg-pink rounded-lg grid place-items-center">aspect-square</div>

Position

ClassCSS
staticposition: static;
relativeposition: relative;
absoluteposition: absolute;
fixedposition: fixed;
stickyposition: sticky;
z-0z-index: 0;
z-10z-index: 10;
z-20z-index: 20;
z-30z-index: 30;
z-40z-index: 40;
z-50z-index: 50;
z-autoz-index: auto;

Placement

s and e mean start and end: left and right in English, swapped in right-to-left languages.

ClassCSS
inset-0inset: 0;
inset-x-0inset-inline: 0;
inset-y-0inset-block: 0;
top-0top: 0;
bottom-0bottom: 0;
start-0inset-inline-start: 0;
end-0inset-inline-end: 0;
inset-1inset: .25rem;
inset-x-1inset-inline: .25rem;
inset-y-1inset-block: .25rem;
top-1top: .25rem;
bottom-1bottom: .25rem;
start-1inset-inline-start: .25rem;
end-1inset-inline-end: .25rem;
inset-2inset: .5rem;
inset-x-2inset-inline: .5rem;
inset-y-2inset-block: .5rem;
top-2top: .5rem;
bottom-2bottom: .5rem;
start-2inset-inline-start: .5rem;
end-2inset-inline-end: .5rem;
inset-3inset: .75rem;
inset-x-3inset-inline: .75rem;
inset-y-3inset-block: .75rem;
top-3top: .75rem;
bottom-3bottom: .75rem;
start-3inset-inline-start: .75rem;
end-3inset-inline-end: .75rem;
inset-4inset: 1rem;
inset-x-4inset-inline: 1rem;
inset-y-4inset-block: 1rem;
top-4top: 1rem;
bottom-4bottom: 1rem;
start-4inset-inline-start: 1rem;
end-4inset-inline-end: 1rem;
inset-6inset: 1.5rem;
inset-x-6inset-inline: 1.5rem;
inset-y-6inset-block: 1.5rem;
top-6top: 1.5rem;
bottom-6bottom: 1.5rem;
start-6inset-inline-start: 1.5rem;
end-6inset-inline-end: 1.5rem;
inset-8inset: 2rem;
inset-x-8inset-inline: 2rem;
inset-y-8inset-block: 2rem;
top-8top: 2rem;
bottom-8bottom: 2rem;
start-8inset-inline-start: 2rem;
end-8inset-inline-end: 2rem;
inset-fullinset: 100%;
inset-x-fullinset-inline: 100%;
inset-y-fullinset-block: 100%;
top-fulltop: 100%;
bottom-fullbottom: 100%;
start-fullinset-inline-start: 100%;
end-fullinset-inline-end: 100%;
inset-1/2inset: 50%;
inset-x-1/2inset-inline: 50%;
inset-y-1/2inset-block: 50%;
top-1/2top: 50%;
bottom-1/2bottom: 50%;
start-1/2inset-inline-start: 50%;
end-1/2inset-inline-end: 50%;
inset-autoinset: auto;
inset-x-autoinset-inline: auto;
inset-y-autoinset-block: auto;
top-autotop: auto;
bottom-autobottom: auto;
start-autoinset-inline-start: auto;
end-autoinset-inline-end: auto;

Overflow

A scrolling box (overflow-y-auto) gets Momo's thin scrollbar. overscroll-contain stops a scroll inside it from moving the page.

ClassCSS
overflow-autooverflow: auto;
overflow-x-autooverflow-x: auto;
overflow-y-autooverflow-y: auto;
overflow-hiddenoverflow: hidden;
overflow-x-hiddenoverflow-x: hidden;
overflow-y-hiddenoverflow-y: hidden;
overflow-clipoverflow: clip;
overflow-x-clipoverflow-x: clip;
overflow-y-clipoverflow-y: clip;
overflow-visibleoverflow: visible;
overflow-x-visibleoverflow-x: visible;
overflow-y-visibleoverflow-y: visible;
overflow-scrolloverflow: scroll;
overflow-x-scrolloverflow-x: scroll;
overflow-y-scrolloverflow-y: scroll;
overscroll-autooverscroll-behavior: auto;
overscroll-containoverscroll-behavior: contain;
overscroll-noneoverscroll-behavior: none;
visiblevisibility: visible;
invisiblevisibility: hidden;
float-startfloat: inline-start;
float-endfloat: inline-end;
float-nonefloat: none;

Floats (float-start, float-end) are for text flowing around a picture. Put .clearfix on the parent so it grows around its floated children.

Pictures and video

ClassCSS
aspect-autoaspect-ratio: auto;
aspect-squareaspect-ratio: 1 / 1;
aspect-videoaspect-ratio: 16 / 9;
aspect-4/3aspect-ratio: 4 / 3;
aspect-3/2aspect-ratio: 3 / 2;
aspect-21/9aspect-ratio: 21 / 9;
aspect-3/4aspect-ratio: 3 / 4;
aspect-9/16aspect-ratio: 9 / 16;
object-containobject-fit: contain;
object-coverobject-fit: cover;
object-fillobject-fit: fill;
object-noneobject-fit: none;
object-scale-downobject-fit: scale-down;
object-centerobject-position: center;
object-topobject-position: top;
object-bottomobject-position: bottom;
object-startobject-position: left;
object-endobject-position: right;

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