Skip to content
v0.9.1
Forms

Select

Write a normal <select class="form-select">. momo.js turns it into a Momo dropdown that looks and works the same in every browser, iPhone included. The real select stays underneath, in sync, so forms and validation keep working.

Basic

<div class="form-field">
  <label class="form-label" for="sel-role">Role</label>
  <select class="form-select" id="sel-role">
    <option>Designer</option>
    <option selected>Developer</option>
    <option>Manager</option>
    <option disabled>Owner (only one)</option>
  </select>
</div>

Placeholder

An empty, disabled first option is shown as grey placeholder text, not as a choice.

<div class="form-field">
  <label class="form-label" for="sel-country">Country</label>
  <select class="form-select" id="sel-country" required>
    <option value="" disabled selected>Choose a country</option>
    <option value="ca">Canada</option>
    <option value="us">United States</option>
    <option value="mx">Mexico</option>
  </select>
</div>

Icons and descriptions

Add data-icon (a Moey icon name) and data-desc (a second line) on options.

<div class="form-field">
  <label class="form-label" for="sel-status">Status</label>
  <select class="form-select" id="sel-status">
    <option value="todo" data-icon="circle-dashed" data-desc="Not started yet">To do</option>
    <option value="doing" data-icon="loader" data-desc="Someone is on it" selected>In progress</option>
    <option value="review" data-icon="eye" data-desc="Waiting for a check">In review</option>
    <option value="done" data-icon="circle-check" data-desc="Shipped">Done</option>
  </select>
</div>

Search

Add data-momo-search for long lists: a search box sits at the top and filters as you type.

<div class="form-field">
  <label class="form-label" for="sel-tz">Time zone</label>
  <select class="form-select" id="sel-tz" data-momo-search>
    <optgroup label="Americas">
      <option>Vancouver (PST)</option>
      <option>Denver (MST)</option>
      <option>Chicago (CST)</option>
      <option selected>Toronto (EST)</option>
      <option>Halifax (AST)</option>
      <option>São Paulo (BRT)</option>
    </optgroup>
    <optgroup label="Europe">
      <option>London (GMT)</option>
      <option>Paris (CET)</option>
      <option>Athens (EET)</option>
    </optgroup>
    <optgroup label="Asia and Pacific">
      <option>Dubai (GST)</option>
      <option>Tokyo (JST)</option>
      <option>Sydney (AEST)</option>
    </optgroup>
  </select>
</div>

Multiple

With multiple, each option gets a check box and the list stays open while you pick.

<div class="form-field">
  <label class="form-label" for="sel-skills">Skills</label>
  <select class="form-select" id="sel-skills" multiple>
    <option selected>Business</option>
    <option>Marketing</option>
    <option selected>Interface design</option>
    <option>User experience</option>
    <option>Development</option>
    <option>Mobile app</option>
  </select>
</div>

Sizes, states and groups

Classes on the select carry over: .form-control-sm, .form-control-lg, .is-invalid. disabled works. It also fits in an .input-group.

Choose a plan to continue.

<div class="form-grid">
  <div class="form-field">
    <label class="form-label" for="sel-sm">Small</label>
    <select class="form-select form-control-sm" id="sel-sm"><option>Weekly</option><option>Monthly</option></select>
  </div>
  <div class="form-field">
    <label class="form-label" for="sel-off">Disabled</label>
    <select class="form-select" id="sel-off" disabled><option>Locked</option></select>
  </div>
  <div class="form-field">
    <label class="form-label" for="sel-bad">With an error</label>
    <select class="form-select is-invalid" id="sel-bad" aria-invalid="true" aria-describedby="sel-bad-msg"><option value="" disabled selected>Pick a plan</option><option>Basic</option><option>Pro</option></select>
    <p class="form-error" id="sel-bad-msg"><i class="mi mi-circle-alert"></i> Choose a plan to continue.</p>
  </div>
  <div class="form-field">
    <label class="form-label" for="sel-amt">Amount</label>
    <div class="input-group">
      <input class="form-control" id="sel-amt" inputmode="decimal" placeholder="0.00">
      <select class="form-select" aria-label="Currency"><option>USD</option><option>CAD</option><option>EUR</option></select>
    </div>
  </div>
</div>

Keep the browser select

Add data-momo-native to skip the Momo dropdown. In Chrome and Edge the open list is still styled by CSS.

<div class="form-field">
  <label class="form-label" for="sel-native">Native</label>
  <select class="form-select" id="sel-native" data-momo-native><option>One</option><option>Two</option></select>
</div>

Phones

On small touch screens the list opens as a bottom sheet with bigger rows; tap outside or pick to close it.

Keyboard

KeyDoes
↓ ↑ Enter SpaceOpen the list (closed), move or pick (open)
Home End PgUp PgDnJump in the list
LettersJump to the option that starts with them
EscClose and go back to the button
TabClose and move on

JavaScript

Selects are set up on load and when added to the page later. Listen to change on the real select as usual. If you change its options or value in code, call:

Momo.select.refresh(document.querySelector('#role'));

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