Skip to content
v0.9.1
Foundations

Code

Code is set in Iosevka Charon Mono. Inline code is a small chip; blocks are dark boxes that wrap long lines by default, with an optional copy button.

Inline

Install with npm install momo-ui, then press Ctrl + K to search.

<p>Install with <code>npm install momo-ui</code>, then press <kbd>Ctrl</kbd> + <kbd>K</kbd> to search.</p>

Any <code> outside a block becomes a chip; <kbd> looks like a key.

Block with a copy button

Wrap a <pre> in .code. A .code-copy button with data-momo-copy copies the block; it shows "Copied" for a moment and tells screen readers. Put it in a .code-head with a file name, or alone (it floats top-right).

index.html
<link rel="stylesheet" href="momo.css">
<script src="momo.js" defer></script>
npm install momo-ui
<div class="code">
  <div class="code-head"><span>index.html</span><button class="code-copy" type="button" data-momo-copy><i class="mi mi-copy" aria-hidden="true"></i> Copy</button></div>
  <pre><code>&lt;link rel="stylesheet" href="momo.css"&gt;
&lt;script src="momo.js" defer&gt;&lt;/script&gt;</code></pre>
</div>
<div class="code">
  <button class="code-copy" type="button" data-momo-copy><i class="mi mi-copy" aria-hidden="true"></i> Copy</button>
  <pre><code>npm install momo-ui</code></pre>
</div>

Wrapping

Long lines wrap by default, so nothing ever scrolls sideways on a phone. Add .code-nowrap when a line must stay whole (it scrolls inside its box instead).

const message = 'This is a very long line of code that keeps going so you can see it wrap onto the next line instead of making the page scroll sideways';
const message = 'This line does not wrap: it scrolls inside the box, and the page itself never scrolls sideways';
<div class="code">
  <pre><code>const message = 'This is a very long line of code that keeps going so you can see it wrap onto the next line instead of making the page scroll sideways';</code></pre>
</div>
<div class="code code-nowrap">
  <pre><code>const message = 'This line does not wrap: it scrolls inside the box, and the page itself never scrolls sideways';</code></pre>
</div>

Light

.code-light uses the paper color, for docs inside light cards.

styles.css
:root {
  --momo-brand: var(--momo-violet);
}
<div class="code code-light">
  <div class="code-head"><span>styles.css</span><button class="code-copy" type="button" data-momo-copy><i class="mi mi-copy" aria-hidden="true"></i> Copy</button></div>
  <pre><code>:root {
  --momo-brand: var(--momo-violet);
}</code></pre>
</div>

Copy anything

data-momo-copy works on any button: data-momo-copy="#id" copies that element (or a field's value), data-momo-copy-text="…" copies fixed text. Listen for momo:copy to show a toast.

<div class="input-group">
  <input class="form-control" id="share-link" value="https://momo.test/invite/8f2k" readonly aria-label="Invite link">
  <button class="btn" type="button" data-momo-copy="#share-link"><i class="mi mi-copy"></i> Copy link</button>
</div>

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