Skip to content
v0.9.1
Forms

Date picker

Pick one date from a calendar: due dates, birthdays, bookings. Put a date field in .datepicker with data-momo-datepicker. The field stays in the form; momo.js turns it into a button and a month. Without JavaScript the plain date field still works.

Basic

Tap the button, tap a day: it is picked and the calendar closes. Today has a ring. Clicking outside or Esc closes it without changes.

<div class="cluster gap-4 items-start">
  <div class="form-field w-64">
    <label class="form-label" for="dp-due">Due date</label>
    <div class="datepicker" data-momo-datepicker>
      <input type="date" id="dp-due" name="due">
    </div>
  </div>
  <div class="form-field w-64">
    <label class="form-label" for="dp-birthday">Birthday</label>
    <div class="datepicker" data-momo-datepicker>
      <input type="date" id="dp-birthday" name="birthday" value="1994-06-18">
    </div>
  </div>
</div>

Quick dates and limits

data-presets adds one-tap choices: today, tomorrow, week (in a week), nextweek (next Monday), yesterday. min and max on the field cross out the days you cannot pick. data-placeholder sets the empty text.

Up to the end of January.

<div class="form-field w-64">
  <label class="form-label" for="dp-delivery">Delivery</label>
  <div class="datepicker" data-momo-datepicker data-presets="today,tomorrow,nextweek" data-placeholder="When should it arrive?">
    <input type="date" id="dp-delivery" name="delivery" min="2026-11-30" max="2027-01-31">
  </div>
  <p class="form-hint">Up to the end of January.</p>
</div>

Several dates

data-momo-datepicker="multiple" on a text field picks any number of separate days: delivery days, days off, the dates of a course. A tap adds a day and a second tap takes it away; "Done" saves. The field holds the dates joined by commas.

Saved as: 2026-12-04,2026-12-11

<div class="form-field w-64">
  <label class="form-label" for="dp-multi">Delivery days</label>
  <div class="datepicker" data-momo-datepicker="multiple" data-today="2026-12-01" id="dp-multi-box">
    <input type="text" id="dp-multi" name="days" value="2026-12-04,2026-12-11">
  </div>
  <p class="form-hint">Saved as: <code id="dp-multi-out">2026-12-04,2026-12-11</code></p>
</div>
<script>
  document.getElementById('dp-multi-box').addEventListener('momo:date', function (e) {
    document.getElementById('dp-multi-out').textContent = e.detail.values.join(',') || '(none)';
  });
</script>
<div class="datepicker" data-momo-datepicker="multiple">
  <input type="text" name="days" value="2026-12-04,2026-12-11">
</div>

<script>
  box.addEventListener('momo:date', (e) => console.log(e.detail.values));   // ["2026-12-04", "2026-12-11"]
</script>

Inline

.datepicker-inline shows the month in the page with no button. A tap saves the day.

<div class="datepicker datepicker-inline" data-momo-datepicker aria-label="Event day">
  <input type="date" name="event" value="2026-12-12">
</div>

Sizes and states

Classes on the field carry over to the button: form-control-sm, form-control-lg, is-invalid, is-valid, and disabled.

<div class="cluster gap-4 items-start">
  <div class="datepicker w-56" data-momo-datepicker aria-label="Small"><input type="date" class="form-control-sm"></div>
  <div class="datepicker w-56" data-momo-datepicker aria-label="Large"><input type="date" class="form-control-lg" value="2026-12-01"></div>
  <div class="datepicker w-56" data-momo-datepicker aria-label="Disabled"><input type="date" disabled></div>
</div>

Keyboard

KeyDoes
↓ on the buttonOpens it on the picked day (or today)
ArrowsMove a day or a week
Home / EndStart or end of the week
PgUp / PgDnA month back or forward (with Shift: a year)
Enter / SpacePicks the day and closes
EscCloses without changes

JavaScript

Momo.datepicker.get('#dp-due');                 // "2026-12-24" or ""
Momo.datepicker.set('#dp-due', '2026-12-24');   // "" clears it
Momo.datepicker.open('#dp-due');
document.addEventListener('momo:date', (e) => console.log(e.detail.value));

The field fires input and change too. Other options on the box: data-week-start="0" starts weeks on Sunday, data-locale="fr" changes the language (default: the page language). On phones the calendar opens as a bottom sheet.

Need a start and an end? Use the Date range.

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