Vitral 0.2
Layout

SplitView

A pane beside the content, inline or as an overlay, that can shrink to a strip of icons when closed.

Import

main.ts
import { SplitView } from '@vitral/vue';

Inline, on the right

A details pane: display-mode="inline" placement="right", open. Closing it gives the list the whole width.

Files

file 1
file 2
file 3
file 4
<script setup lang="ts">import { Button, SplitView } from '@vitral/vue';import { ref } from 'vue'; const details = ref(true);</script> <template>    <SplitView v-model:open="details" class="app-frame" display-mode="inline" placement="right" :open-pane-length="220" pane-label="Details">        <template #pane="{ close }">            <div class="details">                <header class="page-bar">                    <h4>Details</h4>                    <Button icon="close" variant="text" severity="secondary" size="small" aria-label="Close details" @click="close" />                </header>                <dl>                    <dt>Name</dt>                    <dd>report-2026.pdf</dd>                    <dt>Size</dt>                    <dd>1.2 MB</dd>                    <dt>Modified</dt>                    <dd>Yesterday</dd>                </dl>            </div>        </template>        <template #default="{ paneId, toggle, open: isOpen }">            <div class="page">                <header class="page-bar">                    <h4>Files</h4>                    <Button :label="isOpen ? 'Hide details' : 'Show details'" icon="sidebar" severity="secondary" size="small" :aria-controls="paneId" :aria-expanded="isOpen ? 'true' : 'false'" @click="toggle" />                </header>                <div class="cards">                    <div v-for="n in 4" :key="n" class="card" :class="`c${n}`">file {{ n }}</div>                </div>            </div>        </template>    </SplitView></template> <style scoped>.app-frame {    width: 100%;    height: 15rem;    background: var(--vt-content-background);    border: 1px solid var(--vt-content-border-color);    border-radius: var(--vt-border-radius-lg);} .page {    display: flex;    flex-direction: column;    gap: 0.75rem;    padding: 0.75rem 1rem 1rem;} .page-bar {    display: flex;    align-items: center;    gap: 0.5rem;    min-height: 2rem;} .page-bar h4 {    margin: 0;    margin-inline-end: auto;    font-size: 1.125rem;    font-weight: 600;} .cards {    display: grid;    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));    gap: 0.5rem;} .card {    --c: var(--vt-chart-1);    min-height: 4.5rem;    padding: 0.5rem 0.75rem;    font-size: 0.8125rem;    color: var(--vt-text-color);    background: color-mix(in srgb, var(--c) 16%, transparent);    border: 1px solid color-mix(in srgb, var(--c) 50%, transparent);    border-radius: var(--vt-border-radius-md);} .c1 {    --c: var(--vt-chart-1);} .c2 {    --c: var(--vt-chart-2);} .c3 {    --c: var(--vt-chart-3);} .c4 {    --c: var(--vt-chart-4);} .details {    padding: 0.75rem 1rem;} .details dl {    display: grid;    grid-template-columns: auto 1fr;    gap: 0.375rem 0.75rem;    margin: 0.75rem 0 0;    font-size: 0.8125rem;} .details dt {    color: var(--vt-text-muted-color);} .details dd {    margin: 0;}</style>

API

Read from packages/vue/src/components/SplitView/types.ts, so it says what the component actually accepts.

Props

NameTypeDescription
displayMode'inline' | 'overlay' | 'compactInline' | 'compactOverlay'- `inline`: the open pane pushes the content aside; closed, it is gone. - `overlay` (the default): the open pane floats over the content and closes on a press outside or Escape. - `compactInline`: like `inline`, but closed it keeps a strip `compactPaneLength` wide, room for icons. - `compactOverlay`: the strip stays beside the content, and the open pane floats over it.
placement'left' | 'right'The side the pane is on. `left` is the start side: it follows the writing direction.
openPaneLengthnumber | stringWidth of the open pane: pixels, or any CSS length.
compactPaneLengthnumber | stringWidth of the closed pane in the compact modes.
paneLabelstringThe pane's accessible name: it is an `<aside>`, a complementary landmark.
paneIdstringThe pane's id, for a toggle's `aria-controls`. Generated when left out; the slots receive it either way.
asstring | Component—

Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.

Slots

NameSlot propsDescription
pane(props: SplitViewSlotProps)—
default(props: SplitViewSlotProps)—