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.
Hi! Could you send my order to my office instead? The address is Rua das Flores 12, Lisbon.
— Ana
MR Marco Rossi Loved the linen tote Just wanted to say thank you — the tote arrived yesterday and it is perfect. Will order again!Just wanted to say thank you — the tote arrived yesterday and it is perfect. Will order again!
— Marco
LF Lena Fischer Refund for #10419 The shirt was too small, so I sent it back on Monday. When will the refund arrive?The shirt was too small, so I sent it back on Monday. When will the refund arrive?
— Lena
SO Sam Okafor Wholesale prices We run a small shop in Lagos and would like to stock your bags. Do you offer wholesale prices?We run a small shop in Lagos and would like to stock your bags. Do you offer wholesale prices?
— Sam
PN Priya Nair Stock update The new canvas bags arrived at the warehouse — 120 in total. I have updated the stock.The new canvas bags arrived at the warehouse — 120 in total. I have updated the stock.
— Priya
Message
<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.
Hi! Could you send my order to my office instead? The address is Rua das Flores 12, Lisbon.
— Ana
MRMarco RossiLoved the linen toteJust wanted to say thank you — the tote arrived yesterday and it is perfect. Will order again!Just wanted to say thank you — the tote arrived yesterday and it is perfect. Will order again!
— Marco
LFLena FischerRefund for #10419The shirt was too small, so I sent it back on Monday. When will the refund arrive?The shirt was too small, so I sent it back on Monday. When will the refund arrive?
— Lena
SOSam OkaforWholesale pricesWe run a small shop in Lagos and would like to stock your bags. Do you offer wholesale prices?We run a small shop in Lagos and would like to stock your bags. Do you offer wholesale prices?
— Sam
PNPriya NairStock updateThe new canvas bags arrived at the warehouse — 120 in total. I have updated the stock.The new canvas bags arrived at the warehouse — 120 in total. I have updated the stock.
— Priya
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 / attribute | What 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-follow | Where it stacks · remember the divider · open as you arrow through |
.split-list · .split-list-header | The list (scrolls on its own) · a sticky bar on top (search, filters) |
.split-item (a or button) · .is-unread · .active | A row; bold with a dot when unread; the chosen one is marked (set for you, with aria-current) |
.split-item-body · -title · -meta · -subject · -text | The row's parts: name + time, a one-line subject, a two-line preview |
.split-detail · .split-header · .split-back · .split-title · .split-body | The details: a sticky header with the back button (shown when stacked) and title, then the content |
.split-empty | Shown in the details while nothing is chosen (side by side) |
--mo-split-list · --mo-split-height | The list's width (22rem; the divider sets it) · the height (100%) |
Events moey:select · moey:back | An item was chosen (cancelable; detail: { item, id }) · back to the list |
Moey.split(el) | { open(item | id), back(), selected, stacked } |