Skip to content
v0.9.1
Components

Collapse

Show and hide any block with a button, with a smooth slide: a filter panel, extra details, "Read more" on a long text. For a list of questions, the accordion is simpler.

Collapse

A button with data-momo-collapse="#id" opens and closes .collapse#id. It keeps aria-expanded up to date, and the button's words can change with .when-closed / .when-open.

<button class="btn" type="button" data-momo-collapse="#filters-demo"><i class="mi mi-filter" aria-hidden="true"></i> <span class="when-closed">Show filters</span><span class="when-open">Hide filters</span> <i class="mi mi-chevron-down collapse-caret" aria-hidden="true"></i></button>
<div class="collapse" id="filters-demo">
  <div class="box p-4 mt-3 grid sm:grid-cols-3 gap-4">
    <label class="check"><input type="checkbox" checked> In stock</label>
    <label class="check"><input type="checkbox"> On sale</label>
    <label class="check"><input type="checkbox"> Free delivery</label>
  </div>
</div>

Read more

.collapse-peek shows the first lines, fading out, until opened (--collapse-min, 96px).

Momo started as a weekend experiment: what if a design kit looked like a printed poster, with thick black lines and flat colors, instead of soft shadows and gradients?

The first version had six components. People liked how readable it was on a phone in the sun, so it grew: tables, a calendar, a kanban board, then everything a website needs.

Every piece is tested with a real keyboard, a screen reader and a phone before it ships, and none of it needs a build step.

<div class="collapse collapse-peek prose" id="story-demo">
  <p>Momo started as a weekend experiment: what if a design kit looked like a printed poster, with thick black lines and flat colors, instead of soft shadows and gradients?</p>
  <p>The first version had six components. People liked how readable it was on a phone in the sun, so it grew: tables, a calendar, a kanban board, then everything a website needs.</p>
  <p>Every piece is tested with a real keyboard, a screen reader and a phone before it ships, and none of it needs a build step.</p>
</div>
<button class="btn btn-sm btn-ghost mt-2" type="button" data-momo-collapse="#story-demo"><span class="when-closed">Read more</span><span class="when-open">Read less</span> <i class="mi mi-chevron-down collapse-caret" aria-hidden="true"></i></button>

Sideways

.collapse-x opens to the side: a filter column, a side note. --collapse-width sets how wide it opens (18rem).

Status
48 orders

The list makes room when the filters open, and takes it back when they close.

<button class="btn btn-sm mb-3" type="button" data-momo-collapse="#cl-side" id="cl-side-btn"><i class="mi mi-sliders-horizontal"></i> Filters</button>
<div class="flex items-stretch">
  <div class="collapse collapse-x" id="cl-side" style="--collapse-width: 14rem">
    <div class="card" style="height: 100%; margin-inline-end: 1rem"><div class="card-body"><div class="check-group">
      <b>Status</b>
      <label class="check"><input type="checkbox" checked> Paid</label>
      <label class="check"><input type="checkbox"> Unpaid</label>
      <label class="check"><input type="checkbox"> Refunded</label>
    </div></div></div>
  </div>
  <div class="card flex-1 min-w-0"><div class="card-body"><b>48 orders</b><p class="text-muted mb-0">The list makes room when the filters open, and takes it back when they close.</p></div></div>
</div>

Classes and attributes

Class / attributeDoes
.collapseThe block that opens and closes (closed at start; add .is-open to start open)
data-momo-collapse="#id"On a button: opens / closes that block
.collapse-peekClosed means "only the first lines", not hidden
.when-closed / .when-openInside the button: words for each state
.collapse-caretAn icon that turns over when open

From script: Momo.collapse.open('#id'), .close(), .toggle(); a momo:collapse event fires with detail.open.

Accessibility

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