Layout e grids
VAppShell
`VAppShell` é o **core application layout**: shell de aplicação com top bar, navegação lateral e painel utilitário. Tipografia densa: navegação em 14px, legendas de seção em 11px e itens de painel em 12px.
<script setup lang="ts">
import { VAppShell } from 'vueui-nova-kit'
</script>Uso
<VAppShell> <template #sidebar> <AppNavigation /> </template> <template #default> <RouterView /> </template> </VAppShell>Playground
Os controles abaixo são gerados a partir das props declaradas em VAppShell.types.ts; o código acompanha cada mudança.
Exemplos
Variantes, tamanhos e estados, extraídos das stories da biblioteca.
Default
Shell padrão (dashboard): top bar, navegação lateral de 14px, conteúdo com título de 20px e painel utilitário com ações rápidas e atalhos. Use Controls para experimentar as props.
Ver código
<script setup lang="ts">
import { VAppShell, VButton, VCardGrid, VCard } from 'vueui-nova-kit'
const args = {
variant: 'dashboard',
layoutMode: 'desktop',
utilityOpen: true
}
const kpis = [
{
label: 'Total projects',
value: '24',
delta: '+12.04%'
},
{
label: 'Active users',
value: '1,280',
delta: '+8.2%'
},
{
label: 'Deployments',
value: '12',
delta: '+33.0%'
}
]
</script>
<template>
<div style="height:640px;border:1px solid var(--v-color-border);border-radius:12px;overflow:hidden;"><VAppShell v-bind="args">
<div style="display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px;">
<div><h1 style="margin:0;font-size:20px;line-height:1.3;font-weight:600;letter-spacing:-0.01em;">Welcome back, Alex</h1><p style="margin:4px 0 0;font-size:14px;color:var(--v-color-text-muted);">Here's what's happening with your projects today.</p></div>
<VButton size="sm">New report</VButton>
</div>
<VCardGrid :cols="3" :gap="4">
<VCard v-for="k in kpis" :key="k.label" variant="outlined">
<div style="display:flex;flex-direction:column;gap:2px;">
<span style="font-size:12px;color:var(--v-color-text-muted);">{{ k.label }}</span>
<span style="font-size:24px;line-height:1.2;font-weight:600;letter-spacing:-0.02em;">{{ k.value }}</span>
<span style="font-size:12px;font-weight:500;color:var(--v-color-success-strong);">{{ k.delta }}</span>
</div>
</VCard>
</VCardGrid></VAppShell></div>
</template>Collapsed Sidebar
sidebarCollapsed=true: a navegação vira um rail de 72px apenas com ícones, liberando espaço para o conteúdo. O painel utilitário está fechado para destacar o rail.
Ver código
<script setup lang="ts">
import { VAppShell, VButton, VCardGrid, VCard } from 'vueui-nova-kit'
const args = {
variant: 'dashboard',
layoutMode: 'desktop',
utilityOpen: false,
sidebarCollapsed: true
}
const kpis = [
{
label: 'Total projects',
value: '24',
delta: '+12.04%'
},
{
label: 'Active users',
value: '1,280',
delta: '+8.2%'
},
{
label: 'Deployments',
value: '12',
delta: '+33.0%'
}
]
</script>
<template>
<div style="height:640px;border:1px solid var(--v-color-border);border-radius:12px;overflow:hidden;"><VAppShell v-bind="args">
<div style="display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px;">
<div><h1 style="margin:0;font-size:20px;line-height:1.3;font-weight:600;letter-spacing:-0.01em;">Welcome back, Alex</h1><p style="margin:4px 0 0;font-size:14px;color:var(--v-color-text-muted);">Here's what's happening with your projects today.</p></div>
<VButton size="sm">New report</VButton>
</div>
<VCardGrid :cols="3" :gap="4">
<VCard v-for="k in kpis" :key="k.label" variant="outlined">
<div style="display:flex;flex-direction:column;gap:2px;">
<span style="font-size:12px;color:var(--v-color-text-muted);">{{ k.label }}</span>
<span style="font-size:24px;line-height:1.2;font-weight:600;letter-spacing:-0.02em;">{{ k.value }}</span>
<span style="font-size:12px;font-weight:500;color:var(--v-color-success-strong);">{{ k.delta }}</span>
</div>
</VCard>
</VCardGrid></VAppShell></div>
</template>Tablet Layout
layoutMode="tablet": a navegação empilha acima do conteúdo e o painel utilitário vira um drawer lateral (utilityOpen). Aqui o drawer está aberto, em um container de 820px.
Ver código
<script setup lang="ts">
import { VAppShell, VButton, VCardGrid, VCard } from 'vueui-nova-kit'
const args = {
variant: 'dashboard',
layoutMode: 'tablet',
utilityOpen: true
}
const kpis = [
{
label: 'Total projects',
value: '24',
delta: '+12.04%'
},
{
label: 'Active users',
value: '1,280',
delta: '+8.2%'
},
{
label: 'Deployments',
value: '12',
delta: '+33.0%'
}
]
</script>
<template>
<div style="height:720px;border:1px solid var(--v-color-border);border-radius:12px;overflow:hidden;max-width:820px;margin:0 auto;transform:translateZ(0);"><VAppShell v-bind="args">
<div style="display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px;">
<div><h1 style="margin:0;font-size:20px;line-height:1.3;font-weight:600;letter-spacing:-0.01em;">Welcome back, Alex</h1><p style="margin:4px 0 0;font-size:14px;color:var(--v-color-text-muted);">Here's what's happening with your projects today.</p></div>
<VButton size="sm">New report</VButton>
</div>
<VCardGrid :cols="2" :gap="4">
<VCard v-for="k in kpis" :key="k.label" variant="outlined">
<div style="display:flex;flex-direction:column;gap:2px;">
<span style="font-size:12px;color:var(--v-color-text-muted);">{{ k.label }}</span>
<span style="font-size:24px;line-height:1.2;font-weight:600;letter-spacing:-0.02em;">{{ k.value }}</span>
<span style="font-size:12px;font-weight:500;color:var(--v-color-success-strong);">{{ k.delta }}</span>
</div>
</VCard>
</VCardGrid></VAppShell></div>
</template>Editor Variant
variant="editor": conteúdo em tela cheia sem moldura de card, sidebar como explorador de arquivos (slot sidebar) e painel utilitário como inspetor (slot utility).
Ver código
<script setup lang="ts">
import { VAppShell, VButton } from 'vueui-nova-kit'
const args = {
variant: 'editor',
layoutMode: 'desktop',
utilityOpen: true,
brandName: 'Studio',
searchPlaceholder: 'Ir para arquivo…'
}
const files = [
'src',
'App.vue',
'main.ts',
'router.ts',
'styles.css'
]
const lines = [
'<script setup lang=\'ts\'>',
'import { ref } from 'vue'',
'',
'const count = ref(0)',
'</script>',
'',
'<template>',
' <button @click=\'count++\'>',
' Count: {{ count }}',
' </button>',
'</template>'
]
const props = [
[
'Language',
'Vue'
],
[
'Lines',
'11'
],
[
'Encoding',
'UTF-8'
],
[
'Indent',
'2 spaces'
]
]
</script>
<template>
<div style="height:640px;border:1px solid var(--v-color-border);border-radius:12px;overflow:hidden;">
<VAppShell v-bind="args">
<template #sidebar>
<div style="padding:12px 8px;font-size:14px;">
<p style="margin:0 0 4px;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--v-color-text-muted);margin-left:8px;">Explorer</p>
<div v-for="(f, i) in files" :key="f" :style="{padding:'6px 8px',borderRadius:'6px',color:i===1?'var(--v-color-primary-text)':'var(--v-color-text-muted)',background:i===1?'var(--v-color-primary-50)':'transparent',fontWeight:i===1?600:400}">{{ f }}</div>
</div>
</template>
<div style="display:flex;flex-direction:column;height:100%;">
<div style="display:flex;align-items:center;gap:8px;padding:8px 16px;border-bottom:1px solid var(--v-color-border);font-size:13px;">
<span style="font-weight:600;">App.vue</span><span style="color:var(--v-color-text-muted);">Vue SFC</span>
<span style="margin-left:auto;display:flex;gap:8px;"><VButton size="sm" variant="ghost">Format</VButton><VButton size="sm">Run</VButton></span>
</div>
<div style="flex:1;overflow:auto;padding:12px 0;font-family:var(--v-font-family-mono,monospace);font-size:13px;line-height:1.7;background:var(--v-color-surface);">
<div v-for="(l, i) in lines" :key="i" style="display:flex;"><span style="width:44px;text-align:right;padding-right:16px;color:var(--v-color-text-muted);user-select:none;">{{ i + 1 }}</span><pre style="margin:0;font:inherit;">{{ l }}</pre></div>
</div>
</div>
<template #utility>
<div style="font-size:13px;">
<p style="margin:0 0 4px;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--v-color-text-muted);">Inspector</p>
<div v-for="r in props" :key="r[0]" style="display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px solid var(--v-color-border);"><span style="color:var(--v-color-text-muted);">{{ r[0] }}</span><span>{{ r[1] }}</span></div>
</div>
</template>
</VAppShell>
</div>
</template>Utility Panel Open
utilityOpen=true com ações rápidas e atalhos de teclado padrão no painel direito, em linhas compactas de 32px.
Ver código
<script setup lang="ts">
import { VAppShell, VButton, VCardGrid, VCard } from 'vueui-nova-kit'
const args = {
variant: 'dashboard',
layoutMode: 'desktop',
utilityOpen: true,
activeNavItem: 'projects'
}
const kpis = [
{
label: 'Total projects',
value: '24',
delta: '+12.04%'
},
{
label: 'Active users',
value: '1,280',
delta: '+8.2%'
},
{
label: 'Deployments',
value: '12',
delta: '+33.0%'
}
]
</script>
<template>
<div style="height:640px;border:1px solid var(--v-color-border);border-radius:12px;overflow:hidden;"><VAppShell v-bind="args">
<div style="display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px;">
<div><h1 style="margin:0;font-size:20px;line-height:1.3;font-weight:600;letter-spacing:-0.01em;">Welcome back, Alex</h1><p style="margin:4px 0 0;font-size:14px;color:var(--v-color-text-muted);">Here's what's happening with your projects today.</p></div>
<VButton size="sm">New report</VButton>
</div>
<VCardGrid :cols="3" :gap="4">
<VCard v-for="k in kpis" :key="k.label" variant="outlined">
<div style="display:flex;flex-direction:column;gap:2px;">
<span style="font-size:12px;color:var(--v-color-text-muted);">{{ k.label }}</span>
<span style="font-size:24px;line-height:1.2;font-weight:600;letter-spacing:-0.02em;">{{ k.value }}</span>
<span style="font-size:12px;font-weight:500;color:var(--v-color-success-strong);">{{ k.delta }}</span>
</div>
</VCard>
</VCardGrid></VAppShell></div>
</template>Custom Brand And Search
Marca e busca personalizadas: brandName="Acme", searchPlaceholder, searchShortcut="/" e searchQuery preenchida (exibe o botão de limpar).
Ver código
<script setup lang="ts">
import { VAppShell, VButton, VCardGrid, VCard } from 'vueui-nova-kit'
const args = {
variant: 'dashboard',
layoutMode: 'desktop',
utilityOpen: false,
brandName: 'Acme',
searchPlaceholder: 'Buscar no Acme…',
searchShortcut: '/',
searchQuery: 'relatório',
userAvatar: 'AC'
}
const kpis = [
{
label: 'Total projects',
value: '24',
delta: '+12.04%'
},
{
label: 'Active users',
value: '1,280',
delta: '+8.2%'
},
{
label: 'Deployments',
value: '12',
delta: '+33.0%'
}
]
</script>
<template>
<div style="height:640px;border:1px solid var(--v-color-border);border-radius:12px;overflow:hidden;"><VAppShell v-bind="args">
<div style="display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px;">
<div><h1 style="margin:0;font-size:20px;line-height:1.3;font-weight:600;letter-spacing:-0.01em;">Welcome back, Alex</h1><p style="margin:4px 0 0;font-size:14px;color:var(--v-color-text-muted);">Here's what's happening with your projects today.</p></div>
<VButton size="sm">New report</VButton>
</div>
<VCardGrid :cols="3" :gap="4">
<VCard v-for="k in kpis" :key="k.label" variant="outlined">
<div style="display:flex;flex-direction:column;gap:2px;">
<span style="font-size:12px;color:var(--v-color-text-muted);">{{ k.label }}</span>
<span style="font-size:24px;line-height:1.2;font-weight:600;letter-spacing:-0.02em;">{{ k.value }}</span>
<span style="font-size:12px;font-weight:500;color:var(--v-color-success-strong);">{{ k.delta }}</span>
</div>
</VCard>
</VCardGrid></VAppShell></div>
</template>No Utility
showUtility=false: remove o painel direito e o conteúdo ocupa toda a largura restante.
Ver código
<script setup lang="ts">
import { VAppShell, VButton, VCardGrid, VCard } from 'vueui-nova-kit'
const args = {
variant: 'dashboard',
layoutMode: 'desktop',
utilityOpen: true,
showUtility: false
}
const kpis = [
{
label: 'Total projects',
value: '24',
delta: '+12.04%'
},
{
label: 'Active users',
value: '1,280',
delta: '+8.2%'
},
{
label: 'Deployments',
value: '12',
delta: '+33.0%'
}
]
</script>
<template>
<div style="height:640px;border:1px solid var(--v-color-border);border-radius:12px;overflow:hidden;"><VAppShell v-bind="args">
<div style="display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px;">
<div><h1 style="margin:0;font-size:20px;line-height:1.3;font-weight:600;letter-spacing:-0.01em;">Welcome back, Alex</h1><p style="margin:4px 0 0;font-size:14px;color:var(--v-color-text-muted);">Here's what's happening with your projects today.</p></div>
<VButton size="sm">New report</VButton>
</div>
<VCardGrid :cols="3" :gap="4">
<VCard v-for="k in kpis" :key="k.label" variant="outlined">
<div style="display:flex;flex-direction:column;gap:2px;">
<span style="font-size:12px;color:var(--v-color-text-muted);">{{ k.label }}</span>
<span style="font-size:24px;line-height:1.2;font-weight:600;letter-spacing:-0.02em;">{{ k.value }}</span>
<span style="font-size:12px;font-weight:500;color:var(--v-color-success-strong);">{{ k.delta }}</span>
</div>
</VCard>
</VCardGrid></VAppShell></div>
</template>No Built In Top Bar
showBuiltInTopBar=false (ou slot topbar): o shell renderiza apenas corpo e navegação, útil quando o app fornece seu próprio cabeçalho.
Ver código
<script setup lang="ts">
import { VAppShell, VButton, VCardGrid, VCard } from 'vueui-nova-kit'
const args = {
variant: 'dashboard',
layoutMode: 'desktop',
utilityOpen: true,
showBuiltInTopBar: false
}
const kpis = [
{
label: 'Total projects',
value: '24',
delta: '+12.04%'
},
{
label: 'Active users',
value: '1,280',
delta: '+8.2%'
},
{
label: 'Deployments',
value: '12',
delta: '+33.0%'
}
]
</script>
<template>
<div style="height:640px;border:1px solid var(--v-color-border);border-radius:12px;overflow:hidden;"><VAppShell v-bind="args">
<div style="display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px;">
<div><h1 style="margin:0;font-size:20px;line-height:1.3;font-weight:600;letter-spacing:-0.01em;">Welcome back, Alex</h1><p style="margin:4px 0 0;font-size:14px;color:var(--v-color-text-muted);">Here's what's happening with your projects today.</p></div>
<VButton size="sm">New report</VButton>
</div>
<VCardGrid :cols="3" :gap="4">
<VCard v-for="k in kpis" :key="k.label" variant="outlined">
<div style="display:flex;flex-direction:column;gap:2px;">
<span style="font-size:12px;color:var(--v-color-text-muted);">{{ k.label }}</span>
<span style="font-size:24px;line-height:1.2;font-weight:600;letter-spacing:-0.02em;">{{ k.value }}</span>
<span style="font-size:12px;font-weight:500;color:var(--v-color-success-strong);">{{ k.delta }}</span>
</div>
</VCard>
</VCardGrid></VAppShell></div>
</template>Acessibilidade
Checklist literal ("Accessibility — Built with accessibility in mind"):
- ARIA landmarks (banner, navigation, main).
- Keyboard navigation (Tab, Enter, Space).
- Screen reader friendly.
- Focus management.
- High contrast support.
- Responsive and touch friendly.
Props
| Prop | Tipo | Default | Descrição |
|---|---|---|---|
variant | VAppShellVariant | "dashboard" | — |
layoutMode | VAppShellLayoutMode | "desktop" | — |
sidebarCollapsed | boolean | false | — |
utilityOpen | boolean | true | — |
brandName | string | — | — |
searchPlaceholder | string | — | — |
searchShortcut | string | — | — |
searchQuery | string | — | — |
activeNavItem | string | — | — |
navItems | VAppShellNavItem[] | — | — |
quickActions | VAppShellQuickAction[] | — | — |
shortcuts | VAppShellShortcut[] | — | — |
userAvatar | string | — | — |
showUtility | boolean | true | — |
showBuiltInTopBar | boolean | true | — |
Events
| Evento | Payload | Descrição |
|---|---|---|
@update:sidebarCollapsed | collapsed: boolean | — |
@update:utilityOpen | open: boolean | — |
@update:searchQuery | query: string | — |
@update:activeNavItem | value: string | — |
@nav | value: string | — |
@search | query: string | — |
@quick-action | name: string | — |
@shortcut | keys: string | — |
Slots
| Slot | Props do slot |
|---|---|
#topbar | — |
#sidebar | — |
#default | — |
#utility | — |
Fonte: src/components/grid/VAppShell/VAppShell.vue · tipos: src/components/grid/VAppShell/VAppShell.types.ts