Skip to content
v0.9.1
Guides

Customize components

Every component is built from a few CSS variables of its own. Change one on a single element, on a section, or everywhere, and the component redraws itself. No overriding of selectors, no !important.

Three places to set a variable

<div class="cluster" id="cc-demo">
  <button class="btn btn-brand" type="button">Normal</button>
  <button class="btn btn-brand" type="button" style="--btn-radius: 999px; --btn-height: 3rem; --btn-pad: 1.5rem">On this one</button>
  <span class="cluster cc-group">
    <button class="btn" type="button">In this</button><button class="btn" type="button">group</button>
  </span>
</div>
<style>.cc-group .btn { --btn-bg: var(--momo-yellow); --btn-color: var(--momo-on-fill); --btn-radius: 0px; }</style>
<!-- 1. on one element -->
<button class="btn btn-brand" style="--btn-radius: 999px">Save</button>

/* 2. inside one part of the page */
.checkout .btn { --btn-height: 3rem; }

/* 3. everywhere */
.btn { --btn-radius: 999px; }
.card { --card-pad: 1.5rem; }

One thing to know: set the variable on the component itself, or with a selector that reaches it (.checkout .btn). A variable set only on a parent is not picked up, because every component starts from its own defaults.

Your CSS is outside Momo's layers, so these rules win without any tricks. For the settings that shape everything at once (the brand color, the line width, the corner size, the font), use Customize.

Make your own variant

A variant is a class that sets variables. It works with every size and state the component already has.

Night badge
<div class="cluster">
  <button class="btn cc-btn-mint" type="button">Mint button</button>
  <button class="btn btn-sm cc-btn-mint" type="button">Small</button>
  <button class="btn cc-btn-mint" type="button" disabled>Disabled</button>
  <span class="badge cc-badge-night">Night badge</span>
</div>
<style>
  .cc-btn-mint { --btn-bg: var(--momo-green); --btn-color: var(--momo-on-fill); --btn-radius: 999px; }
  .cc-badge-night { --badge-bg: var(--momo-ink); --badge-color: var(--momo-paper); }
</style>
.btn-mint { --btn-bg: var(--momo-green); --btn-color: var(--momo-on-fill); --btn-radius: 999px; }
.badge-night { --badge-bg: var(--momo-ink); --badge-color: var(--momo-paper); }

The variables, by component

ComponentIts variables
Button--btn-bg, --btn-color, --btn-border, --btn-height, --btn-pad, --btn-font-size, --btn-radius
Card--card-bg, --card-color, --card-border, --card-pad, --card-gap, --card-radius, --card-muted
Badge, Chips--badge-bg, --badge-color, --badge-border, --chip-height
Fields--field-bg, --field-border, --field-shadow, --field-height
Checkbox & switch--check-color, --check-mark, --check-size, --switch-w, --switch-h
Slider, Rating--slider-color, --slider-track, --slider-height, --rating-color, --rating-size
Alert & banner--alert-bg, --alert-color, --alert-muted, --banner-bg, --banner-color
Avatar--avatar-size
Tabs--tab-active-bg, --tab-active-color, --tab-height
Table--table-pad-y, --table-pad-x, --table-line, --table-head-bg, --table-head-color, --table-width
Dialog & toast--dialog-width, --toast-edge
Progress--progress-color, --progress-track, --progress-height, --ring-size, --ring-width
Steps, Tree view--step-size, --tree-indent, --tree-row
Navbar--navbar-height, --navbar-bg, --navbar-color, --navbar-muted, --navbar-line
App shell--sidebar-width, --sidebar-bg, --sidebar-color, --topbar-height
Hero, Footer--hero-bg, --hero-color, --hero-pad, --hero-max, --footer-bg, --footer-color, --footer-pad
Container & section--container-max, --container-pad, --section-pad, --section-bg
Carousel, Gallery--carousel-gap, --slide-size, --gallery-gap
Split view, Inbox--split-list, --inbox-list
Description list, Media object--dl-label, --dl-gap, --media-gap, --media-size
Code--code-bg, --code-color, --code-muted, --code-line
Charts--chart-1, to --chart-8,, --chart-grid, --chart-axis

Each component's own page has the full list with what each one does.

Good habits

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