Skip to content
v0.9.1
Components

Button

Flat by default: an ink border and a light tint on hover. Add a hard shadow, a press effect or a lift only where you want it.

Basic

Use .btn on a <button> or a link. Plain .btn is white with ink text.

A link
<button class="btn" type="button">Cancel</button>
<button class="btn btn-brand" type="button">Save settings</button>
<a class="btn" href="#">A link</a>

Colors

.btn-<color> fills it with any palette color and ink text. .btn-brand uses the brand color (ink by default). .btn-ink is solid black (white in dark mode).

<button class="btn btn-yellow" type="button">Yellow</button>
<button class="btn btn-violet" type="button">Violet</button>
<button class="btn btn-cyan" type="button">Cyan</button>
<button class="btn btn-green" type="button">Green</button>
<button class="btn btn-orange" type="button">Orange</button>
<button class="btn btn-pink" type="button">Pink</button>
<button class="btn btn-red" type="button">Red</button>
<button class="btn btn-blue" type="button">Blue</button>
<button class="btn btn-lime" type="button">Lime</button>
<button class="btn btn-gray" type="button">Gray</button>
<button class="btn btn-ink" type="button">Ink</button>

Ghost and link

.btn-ghost has no border or background: the ink outline appears on hover. .btn-link looks like a link.

<button class="btn btn-ghost" type="button">Ghost</button>
<button class="btn btn-link" type="button">View details</button>

Shadow, press and raise

Buttons are flat until you ask. .btn-shadow adds a still hard shadow. .btn-press adds the shadow, lifts on hover and pushes into it when clicked. .btn-raise is flat at rest and lifts with its shadow on hover. To turn shadows on everywhere, put class="momo-shadows" on <html> (then .btn-flat keeps one flat).

<button class="btn btn-brand" type="button">Flat (default)</button>
<button class="btn btn-brand btn-shadow" type="button">btn-shadow</button>
<button class="btn btn-brand btn-press" type="button">btn-press</button>
<button class="btn btn-brand btn-raise" type="button">btn-raise</button>

With icons

Put a Moey icon before or after the text.

<button class="btn btn-brand" type="button"><i class="mi mi-save"></i> Save settings</button>
<button class="btn" type="button"><i class="mi mi-download"></i> Download</button>
<button class="btn btn-ink" type="button">Next <i class="mi mi-arrow-right"></i></button>
<button class="btn btn-sm" type="button"><i class="mi mi-check-check"></i> Mark read</button>

Icon buttons

.btn-icon makes it square. Always give it an aria-label. Add .btn-pill for a round one.

<button class="btn btn-icon" type="button" aria-label="Back"><i class="mi mi-arrow-left"></i></button>
<button class="btn btn-icon" type="button" aria-label="Menu"><i class="mi mi-menu"></i></button>
<button class="btn btn-icon btn-brand" type="button" aria-label="Add"><i class="mi mi-plus"></i></button>
<button class="btn btn-icon btn-sm" type="button" aria-label="More"><i class="mi mi-ellipsis"></i></button>
<button class="btn btn-icon btn-pill btn-lg btn-brand" type="button" aria-label="New task"><i class="mi mi-plus"></i></button>

Sizes

.btn-sm (32px), default (40px), .btn-lg (52px). On touch screens every size grows a little so it is easy to tap.

<button class="btn btn-sm btn-violet" type="button">Small</button>
<button class="btn btn-violet" type="button">Default</button>
<button class="btn btn-lg btn-violet" type="button">Large</button>

Shapes

.btn-pill for filter chips, .btn-block for full width (common on phones).


<div class="btn-row">
  <button class="btn btn-pill btn-ink" type="button">All</button>
  <button class="btn btn-pill" type="button">Mentions</button>
  <button class="btn btn-pill" type="button">System</button>
</div>
<hr>
<button class="btn btn-lg btn-block btn-brand" type="button"><i class="mi mi-save"></i> Save settings</button>

Selected

For toggles, set aria-pressed="true" (or .is-active). The button turns ink.

<button class="btn btn-sm" type="button" aria-pressed="true">Monthly</button>
<button class="btn btn-sm" type="button" aria-pressed="false">Yearly</button>

Disabled and loading

Use the disabled attribute on buttons, aria-disabled="true" on links. .is-loading shows a spinner and keeps the width.

Disabled link
<button class="btn btn-brand" type="button" disabled>Disabled</button>
<a class="btn" href="#" aria-disabled="true">Disabled link</a>
<button class="btn btn-brand is-loading" type="button" aria-busy="true"><span>Saving</span></button>

Row of buttons

.btn-row lines buttons up with a gap and wraps them on small screens.

<div class="btn-row">
  <button class="btn btn-brand" type="button">Publish</button>
  <button class="btn" type="button">Save draft</button>
  <button class="btn btn-ghost" type="button">Cancel</button>
</div>

Close button

A ready-made × for dialogs, banners and cards: .btn-close (the × is a Moey icon, so no <i> is needed). It takes the text color; .btn-close-sm and -lg change its size. It has no words, so always give it an aria-label.

On dark
<button class="btn-close btn-close-sm" type="button" aria-label="Close"></button>
<button class="btn-close" type="button" aria-label="Close"></button>
<button class="btn-close btn-close-lg" type="button" aria-label="Close"></button>
<span class="box bg-ink p-2 hstack gap-2">On dark <button class="btn-close" type="button" aria-label="Close"></button></span>

Joined buttons are on the Button group page.

Accessibility

Variables

Set these on a button (or a parent) to make your own variant.

VariableDefault
--btn-bg / --btn-colorSurface / ink
--btn-borderInk line
--btn-depth0 = flat (default), 1 = shadow (.btn-shadow, .btn-press)
--btn-scaleShadow size: .5 small, .75 default, 1 large
--btn-height2.5rem (2.75rem on touch)
--btn-pad / --btn-font-size1rem / 1rem
--btn-radius--momo-radius

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