Skip to content
v0.9.1
Components

Split view

A list and the details of what you picked: an inbox, contacts, tickets, settings. Side by side when there is room, with a divider you can drag; one screen at a time on phones, where the details slide in and the phone's own Back returns to the list.

List and details

Click a message. Drag the line between the two sides to resize the list (double click it to reset).

<div class="split" data-momo-split data-persist="docs-inbox" style="--split-height: 26rem" id="split-inbox">
  <div class="split-list" aria-label="Messages">
    <a class="split-item is-unread" href="#m1" data-id="m1" data-title="Order #10421: new address">
      <span class="avatar avatar-sm bg-pink">AK</span>
      <span class="split-item-body">
        <span class="split-item-title"><span>Ana Kim</span><span class="split-item-meta">9:41</span></span>
        <span class="split-item-subject">Order #10421: new address</span>
        <span class="split-item-text">Hi! Could you send my order to my office instead? The address is Rua das Flores 12, Lisbon.</span>
      </span>
      <template>
        <div class="person mb-4"><span class="avatar bg-pink">AK</span><span class="person-text"><span class="person-name">Ana Kim</span><span class="person-sub">9:41</span></span></div>
        <p>Hi! Could you send my order to my office instead? The address is Rua das Flores 12, Lisbon.</p>
        <p>Thanks, Ana</p>
        <button class="btn btn-brand btn-sm" type="button"><i class="mi mi-reply"></i> Reply</button>
      </template>
    </a>
    <a class="split-item is-unread" href="#m2" data-id="m2" data-title="Loved the linen tote">
      <span class="avatar avatar-sm bg-cyan">MR</span>
      <span class="split-item-body">
        <span class="split-item-title"><span>Marco Rossi</span><span class="split-item-meta">8:15</span></span>
        <span class="split-item-subject">Loved the linen tote</span>
        <span class="split-item-text">Just wanted to say thank you: the tote arrived yesterday and it is perfect. Will order again!</span>
      </span>
      <template>
        <div class="person mb-4"><span class="avatar bg-cyan">MR</span><span class="person-text"><span class="person-name">Marco Rossi</span><span class="person-sub">8:15</span></span></div>
        <p>Just wanted to say thank you: the tote arrived yesterday and it is perfect. Will order again!</p>
        <button class="btn btn-brand btn-sm" type="button"><i class="mi mi-reply"></i> Reply</button>
      </template>
    </a>
    <a class="split-item" href="#m3" data-id="m3" data-title="Refund for #10419">
      <span class="avatar avatar-sm bg-yellow">LF</span>
      <span class="split-item-body">
        <span class="split-item-title"><span>Lena Fischer</span><span class="split-item-meta">Yesterday</span></span>
        <span class="split-item-subject">Refund for #10419</span>
        <span class="split-item-text">The shirt was too small, so I sent it back on Monday. When will the refund arrive?</span>
      </span>
      <template>
        <div class="person mb-4"><span class="avatar bg-yellow">LF</span><span class="person-text"><span class="person-name">Lena Fischer</span><span class="person-sub">Yesterday</span></span></div>
        <p>The shirt was too small, so I sent it back on Monday. When will the refund arrive?</p>
        <button class="btn btn-brand btn-sm" type="button"><i class="mi mi-reply"></i> Reply</button>
      </template>
    </a>
    <a class="split-item" href="#m4" data-id="m4" data-title="Wholesale prices">
      <span class="avatar avatar-sm bg-lime">SO</span>
      <span class="split-item-body">
        <span class="split-item-title"><span>Sam Okafor</span><span class="split-item-meta">Mon</span></span>
        <span class="split-item-subject">Wholesale prices</span>
        <span class="split-item-text">We run a small shop in Lagos and would like to stock your bags. Do you offer wholesale prices?</span>
      </span>
      <template>
        <div class="person mb-4"><span class="avatar bg-lime">SO</span><span class="person-text"><span class="person-name">Sam Okafor</span><span class="person-sub">Monday</span></span></div>
        <p>We run a small shop in Lagos and would like to stock your bags. Do you offer wholesale prices?</p>
        <button class="btn btn-brand btn-sm" type="button"><i class="mi mi-reply"></i> Reply</button>
      </template>
    </a>
    <a class="split-item" href="#m5" data-id="m5" data-title="Stock update">
      <span class="avatar avatar-sm bg-violet">PN</span>
      <span class="split-item-body">
        <span class="split-item-title"><span>Priya Nair</span><span class="split-item-meta">Nov 20</span></span>
        <span class="split-item-subject">Stock update</span>
        <span class="split-item-text">The new canvas bags arrived at the warehouse: 120 in total. I have updated the stock.</span>
      </span>
      <template>
        <div class="person mb-4"><span class="avatar bg-violet">PN</span><span class="person-text"><span class="person-name">Priya Nair</span><span class="person-sub">Nov 20</span></span></div>
        <p>The new canvas bags arrived at the warehouse: 120 in total. I have updated the stock.</p>
      </template>
    </a>
  </div>
  <div class="split-detail">
    <header class="split-header">
      <button class="split-back" type="button" aria-label="Back to messages"></button>
      <h2 class="split-title">Message</h2>
    </header>
    <div class="split-body"></div>
    <div class="split-empty"><i class="mi mi-mail"></i> Choose a message to read it</div>
  </div>
</div>

The split follows its own width, not the screen's: in a narrow panel it stacks even on a big monitor. Change where with data-split-at="900" (pixels, 640 by default). Give it a height: in an app shell it fills the content area by itself (100%); anywhere else set --split-height. data-persist="name" remembers the divider's place in the browser.

On phones

Tap a message: the details slide in over the list, with a back button. Back (the button, Esc, or the phone's Back) slides them away and puts you on the message you came from. This one is narrow, so it is stacked on any screen:

Contact

<div class="split w-80" data-momo-split style="--split-height: 24rem" id="split-phone">
  <div class="split-list" aria-label="Contacts">
    <button class="split-item" type="button" data-id="c1" data-title="Ana Kim">
      <span class="avatar avatar-sm bg-pink">AK</span>
      <span class="split-item-body"><span class="split-item-title"><span>Ana Kim</span></span><span class="split-item-text">Designer, Toronto</span></span>
      <template><p><b>Email</b><br>ana@momo.test</p><p><b>Phone</b><br>+1 416 555 0142</p></template>
    </button>
    <button class="split-item" type="button" data-id="c2" data-title="Max Ruiz">
      <span class="avatar avatar-sm bg-cyan">MR</span>
      <span class="split-item-body"><span class="split-item-title"><span>Max Ruiz</span></span><span class="split-item-text">Support, Madrid</span></span>
      <template><p><b>Email</b><br>max@momo.test</p><p><b>Phone</b><br>+34 91 555 0199</p></template>
    </button>
    <button class="split-item" type="button" data-id="c3" data-title="Lea Novak">
      <span class="avatar avatar-sm bg-lime">LN</span>
      <span class="split-item-body"><span class="split-item-title"><span>Lea Novak</span></span><span class="split-item-text">Engineer, Ljubljana</span></span>
      <template><p><b>Email</b><br>lea@momo.test</p><p><b>Phone</b><br>+386 1 555 0107</p></template>
    </button>
  </div>
  <div class="split-detail">
    <header class="split-header"><button class="split-back" type="button" aria-label="Back to contacts"></button><h2 class="split-title">Contact</h2></header>
    <div class="split-body"></div>
  </div>
</div>

Filling the details

Two ways. Listen to momo:select and load the item (most apps), or keep each item's details in a <template> inside it, with data-title for the header: Momo puts them in .split-body and .split-title for you (the demos above do this).

inbox.addEventListener('momo:select', async (e) => {
  const body = inbox.querySelector('.split-body');
  body.innerHTML = await loadMessage(e.detail.id);      // e.preventDefault() refuses the choice
});

const split = Momo.split('#inbox');
split.open('m3');        // by data-id, or pass the item
split.back();            // stacked: back to the list
split.selected;          // the chosen item
split.stacked;           // true when it shows one side at a time

Keyboard

Reference

Class / attributeWhat it does
.split[data-momo-split]The split; side by side from 640px of its own width, stacked below. .split-flush drops its frame
data-split-at, data-persist, data-split-followWhere it stacks, remember the divider, open as you arrow through
.split-list, .split-list-headerThe list (scrolls on its own), a sticky bar on top (search, filters)
.split-item (a or button), .is-unreadA row; bold with a dot when unread; the chosen one gets aria-current
.split-item-body, -title, -meta, -subject, -textThe row's parts: name and time, a one-line subject, a two-line preview
.split-detail, .split-header, .split-back, .split-title, .split-bodyThe details: a header with the back button (shown when stacked) and title, then the content
.split-emptyShown in the details while nothing is chosen (side by side)
--split-list, --split-heightThe list's width (22rem; the divider sets it), the height (100%)
Eventsmomo:select (cancelable; { item, id }), momo:back

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