Moey Icons
No results. Try “dialog”, “dark” or “grid”.
Moey extras

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 gesture returns to the list.

<div class="split" data-moey-split data-moey-persist="inbox">
  <div class="split-list" aria-label="Messages">
    <a class="split-item is-unread" href="#m1" data-id="m1">
      <span class="avatar">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?</span>
      </span>
    </a>
    …
  </div>
  <div class="split-detail">
    <header class="split-header">
      <button class="split-back" aria-label="Back to messages"></button>
      <h2 class="split-title">Message</h2>
    </header>
    <div class="split-body"></div>
    <div class="split-empty">Choose a message to read it</div>
  </div>
</div>

<script>
  inbox.addEventListener('moey:select', async (e) => {
    const body = inbox.querySelector('.split-body');
    body.innerHTML = await loadMessage(e.detail.id);   // or keep it in the item: <template>…</template>
  });
</script>

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-moey-split-at="900" (pixels, 640 by default). Give it a height — in an app shell, h-full inside the content area; anywhere else a size like h-128 or --mo-split-height.

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.

A real 360px page — tap a message

Filling the details

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

<a class="split-item" href="#m1" data-id="m1" data-title="Order #10421 — new address">
  …the row…
  <template>
    <p>Hi! Could you send my order to my office instead?</p>
  </template>
</a>

Keyboard

↑ ↓ Home End move through the list, Enter opens. With data-moey-split-follow the details follow as you move (side by side only). The divider takes ← → (Shift for bigger steps); double-click it to reset. When stacked, opening moves focus to the details' title and Esc goes back.

Reference

Class / attributeWhat it does
.split[data-moey-split]The split; side by side from 640px of its own width, stacked below
data-moey-split-at="900" · data-moey-persist="inbox" · data-moey-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-unread · .activeA row; bold with a dot when unread; the chosen one is marked (set for you, with aria-current)
.split-item-body · -title · -meta · -subject · -textThe row's parts: name + time, a one-line subject, a two-line preview
.split-detail · .split-header · .split-back · .split-title · .split-bodyThe details: a sticky 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)
--mo-split-list · --mo-split-heightThe list's width (22rem; the divider sets it) · the height (100%)
Events moey:select · moey:backAn item was chosen (cancelable; detail: { item, id }) · back to the list
Moey.split(el){ open(item | id), back(), selected, stacked }