Blocks
Layout
Dashboard shell with optional nav, left, and right rails, toolbar, main column, and footer.
Usage
Use MeLayout as the root layout: fill only the slots you need (header, nav, left and optional right rails, toolbar, analytics, main content, footer). Below lg, rails open as slideovers unless you pass inlineSidebarsOnMobile.
Rail sizing
Nav rail width is fixed at 5.5rem. Set unit and optional leftArea / rightArea for the resizable sidebars. The default unit is px; use unit="%" when your numbers are percentages (as in the example).
App
Content
<template>
<MeLayout
unit="%"
:left-area="{
minSize: 10,
defaultSize: 18,
maxSize: 28,
resizable: true,
collapsible: true
}"
:right-area="{
minSize: 8,
defaultSize: 12,
maxSize: 20,
resizable: false,
collapsible: false
}"
>
<template #header><div class="flex h-12 w-full items-center border-b border-default px-4 text-sm font-medium">App</div></template>
<template #nav-area><div class="flex h-full items-center justify-center p-2 text-xs text-muted">Nav</div></template>
<template #left-area><div class="p-3 text-sm">Left</div></template>
<template #default><div class="p-4 text-sm">Content</div></template>
<template #right-area><div class="p-3 text-sm">Right</div></template>
</MeLayout>
</template>
API
Props
| Prop | Default | Type |
|---|---|---|
unit | 'px' | '%' | 'px' | 'rem' Unit for left and right sidebar sizes. |
inlineSidebarsOnMobile | [] | LayoutInlineSidebarKey[] Rails that stay in the row under lg instead of slideover. |
storage | 'cookie' | 'cookie' | 'local' Where sizes are stored. |
storageKey | 'layout' | string Storage key for this layout group. |
leftArea | { resizable: true, collapsible: true } | LayoutLeftAreaConfig minSize, defaultSize, maxSize, resizable, collapsible. Defaults: px 200/240/400, % 10/15/25, rem 12/15/25. |
rightArea | { resizable: true, collapsible: true } | LayoutRightAreaConfig Same as leftArea. Defaults: px 260/358/640, % 8/12/20, rem 16/22.5/40. Set autoWidth: true to let the slot width be driven by its content or external CSS — disables resizing, collapsing, and fixed sizing. Useful for web component portals. |
Slots
| Slot | Type |
|---|---|
header | void |
nav-area | LayoutMobileSidebarSlotProps |
nav-area-header | LayoutSidebarRailHeaderSlotProps |
left-area | LayoutMobileSidebarSlotProps |
left-area-header | LayoutSidebarRailHeaderSlotProps |
toolbar | LayoutMobileToolbarSlotProps |
analytics | void |
default | void |
right-area | LayoutMobileSidebarSlotProps |
right-area-header | LayoutSidebarRailHeaderSlotProps |
footer | void |
Rail slot bodies use horizontal clipping; wrap wide content in overflow-x-auto min-w-0.