Launch checklist
From Dana FischerThe release is ready for Thursday. Please read the checklist and tell me what is missing.
Build a mail client with a folder rail that collapses to its icons, a message list, and a reading pane. collapsed-size keeps the icons of the rail visible, and :state(--collapsed) hides the labels. toggle() collapses the rail from its button, and persist-key saves the layout.
The release is ready for Thursday. Please read the checklist and tell me what is missing.
The following example assumes that you have imported the component and set up the theme.
<div class="splitter-mail">75 collapsed lines
<sv-splitter persist-key="docs-splitter-mail-client"> <sv-splitter-panel aria-label="Folders" collapsed-size="3.25rem" collapsible max="15rem" min="3.25rem" size="min(11rem, 28%)" > <nav aria-label="Mail folders"> <button type="button" class="btn rail-toggle" aria-label="Folders"> <!-- Menu --> <svg aria-hidden="true" viewBox="0 0 24 24"> <path d="M4 7h16M4 12h16M4 17h16" /> </svg> </button> <a aria-current="page" href="#inbox"> <!-- Inbox --> <svg aria-hidden="true" viewBox="0 0 24 24"> <path d="M4 13h4l2 3h4l2-3h4M6 5h12l2 8v6H4v-6z" /> </svg> <span class="label">Inbox</span> <span class="label count">12</span> </a> <a href="#sent"> <!-- Sent --> <svg aria-hidden="true" viewBox="0 0 24 24"> <path d="m4 12 16-8-5 16-3-6z" /> </svg> <span class="label">Sent</span> </a> <a href="#drafts"> <!-- Drafts --> <svg aria-hidden="true" viewBox="0 0 24 24"> <path d="M4 20h4L19 9l-4-4L4 16z" /> </svg> <span class="label">Drafts</span> </a> <a href="#trash"> <!-- Trash --> <svg aria-hidden="true" viewBox="0 0 24 24"> <path d="M5 7h14M10 7V4h4v3M7 7l1 13h8l1-13" /> </svg> <span class="label">Trash</span> </a> </nav> </sv-splitter-panel>
<sv-splitter-panel aria-label="Messages" max="24rem" min="25%" size="min(15rem, 30%)"> <ul class="messages"> <li aria-current="true"> <strong>Dana Fischer</strong> <span>Launch checklist</span> </li> <li> <strong>Omar Haddad</strong> <span>Invoice for March</span> </li> <li> <strong>Mei Lin</strong> <span>Design review notes</span> </li> </ul> </sv-splitter-panel>
<sv-splitter-panel aria-label="Message" min="20%"> <article> <h3>Launch checklist</h3> <small>From Dana Fischer</small> <p> The release is ready for Thursday. Please read the checklist and tell me what is missing. </p> </article> </sv-splitter-panel> </sv-splitter></div>
<script type="application/x-typescript" module>12 collapsed lines
import type { SplitterPanel } from "@staticview/ui/splitter";
const folders = document.querySelector<SplitterPanel>(".splitter-mail sv-splitter-panel")!; const railToggle = folders.querySelector("button")!;
const syncExpanded = () => { railToggle.ariaExpanded = String(!folders.collapsed); };
railToggle.addEventListener("click", () => folders.toggle()); folders.addEventListener("collapsedchange", syncExpanded); syncExpanded();</script>
<style>94 collapsed lines
.splitter-mail { sv-splitter { block-size: 22rem; font-size: 0.9rem; background-color: var(--sv-gray-7); border-radius: var(--sv-bdr-rad-md); }
nav { display: grid; gap: 0.25em; padding: 0.5em; }
.rail-toggle { justify-self: start; padding: 0.5em; line-height: 0; }
a { display: flex; gap: 0.75em; align-items: center; padding: 0.5em; color: inherit; white-space: nowrap; text-decoration: none; border-radius: var(--sv-bdr-rad-sm);
&:hover { background-color: var(--sv-gray-6); } }
[aria-current] { background-color: var(--sv-gray-5); }
svg { flex: none; inline-size: 1.25em; fill: none; stroke: currentcolor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.count { margin-inline-start: auto; font-size: 0.85em; color: var(--sv-gray-3); }
sv-splitter-panel:state(--collapsed) .label { display: none; }
.messages { padding: 0; margin: 0; list-style: none; }
li { display: grid; padding: 0.75em; border-block-end: 1px solid var(--sv-gray-5); }
li span { color: var(--sv-gray-3); }
article { padding: 0.75em; overflow-wrap: break-word; }
h3 { margin: 0; font-size: 1.1em; }
small { color: var(--sv-gray-3); }
sv-splitter-panel::part(content) { overflow-x: hidden; scrollbar-width: thin; } }</style>