Skip to content
v0.9.1
Forms

Number stepper

A number with − and + buttons. Put a number field in .stepper: momo.js adds the buttons, keeps the value inside min and max, and keeps counting while a button is held.

Basic

<div class="stepper">
  <input type="number" min="0" max="20" value="1" aria-label="Quantity">
</div>

Steps and decimals

Use step for bigger jumps or decimals. Typed values outside the limits are pulled back in.

<div class="stepper">
  <input type="number" min="0" max="100" step="5" value="25" aria-label="Percent">
</div>
<div class="stepper">
  <input type="number" min="0" max="5" step="0.5" value="1.5" aria-label="Hours">
</div>

With a label

Up to 12 people.

<div class="form-field">
  <label class="form-label" for="st-guests">Guests</label>
  <div class="stepper">
    <input id="st-guests" type="number" min="1" max="12" value="2">
  </div>
  <p class="form-hint">Up to 12 people.</p>
</div>

Round

.stepper-round drops the outer box and uses round buttons. Inside a .stepper-field it makes a full-width row with the label on the left.


<div class="stepper stepper-round">
  <input type="number" min="0" max="9" value="1" aria-label="Tickets">
</div>
<hr>
<label class="stepper-field">
  <span>Choose amount</span>
  <span class="stepper stepper-round">
    <input type="number" min="1" max="99" value="1" aria-label="Amount">
  </span>
</label>

Sizes and colors

<div class="stepper stepper-sm">
  <input type="number" min="0" value="3" aria-label="Small">
</div>
<div class="stepper">
  <input type="number" min="0" value="3" aria-label="Default">
</div>
<div class="stepper stepper-lg stepper-brand">
  <input type="number" min="0" value="3" aria-label="Large">
</div>
<div class="stepper stepper-block">
  <input type="number" min="0" max="50" value="10" aria-label="Seats">
</div>

Disabled

<div class="stepper">
  <input type="number" value="4" disabled aria-label="Locked">
</div>

Your own buttons

Write the buttons yourself to change icons or labels: give them data-momo-step="-1" and data-momo-step="1".

<div class="stepper">
  <button class="stepper-btn" type="button" data-momo-step="-1" aria-label="Remove one"><i class="mi mi-circle-minus"></i></button>
  <input type="number" min="0" max="10" value="5" aria-label="Items">
  <button class="stepper-btn" type="button" data-momo-step="1" aria-label="Add one"><i class="mi mi-circle-plus"></i></button>
</div>

Accessibility

Variables

VariableDefault
--stepper-height2.75rem (buttons are square)
--stepper-btn-bgPaper (brand with .stepper-brand)

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