Navegação
VSidebar
Painel de navegação persistente com brand, busca global (com filtro), menus multi-nível com acordeão, grupos colapsáveis e área de usuário. Segue tokens `--v-sidebar-*` e Light Mode como referência principal.
<script setup lang="ts">
import { VSidebar } from 'vueui-nova-kit'
</script>Uso
<script setup lang="ts">
</script>
<template>
</template>Playground
Os controles abaixo são gerados a partir das props declaradas em VSidebar.types.ts; o código acompanha cada mudança.
Exemplos
Variantes, tamanhos e estados, extraídos das stories da biblioteca.
Default
Variação Padrão. Estado padrão do componente; use a aba Controls para experimentar as props ao vivo.
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const args = {
size: 'md',
brandName: 'VueUI Nova',
userName: 'Alex Chen',
userEmail: 'alex@nova.dev'
}
const active = ref('dashboard')
const expanded = ref(null)
const collapsed = ref(false)
const wrapStyle = 'display:flex;'
</script>
<template>
<div :style="wrapStyle"><VSidebar v-bind="args" v-model:activeItem="active" v-model:expandedSections="expanded" v-model:collapsed="collapsed" /></div>
</template>Collapsed
Variação Recolhido. Props: collapsed=true.
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const args = {
size: 'md',
brandName: 'VueUI Nova',
userName: 'Alex Chen',
userEmail: 'alex@nova.dev',
collapsed: true
}
const active = ref('dashboard')
const expanded = ref(null)
const collapsed = ref(true)
const wrapStyle = 'display:flex;'
</script>
<template>
<div :style="wrapStyle"><VSidebar v-bind="args" v-model:activeItem="active" v-model:expandedSections="expanded" v-model:collapsed="collapsed" /></div>
</template>Icons
Variação Ícones. Props: variant="icons", showSearch=false, showFooter=false, activeItem="dashboard".
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const args = {
size: 'md',
brandName: 'VueUI Nova',
userName: 'Alex Chen',
userEmail: 'alex@nova.dev',
variant: 'icons',
showSearch: false,
showFooter: false,
activeItem: 'dashboard'
}
const active = ref('dashboard')
const expanded = ref(null)
const collapsed = ref(false)
const wrapStyle = 'display:flex;align-items:flex-start;min-height:640px;padding:16px;background:var(--v-color-neutral-50);'
</script>
<template>
<div :style="wrapStyle"><VSidebar v-bind="args" v-model:activeItem="active" v-model:expandedSections="expanded" v-model:collapsed="collapsed" /></div>
</template>Icons No Toggle
Variação Ícones sem alternador. Props: variant="icons", showSearch=false, showFooter=false, showCollapseToggle=false, activeItem="portfolio".
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const args = {
size: 'md',
brandName: 'VueUI Nova',
userName: 'Alex Chen',
userEmail: 'alex@nova.dev',
variant: 'icons',
showSearch: false,
showFooter: false,
showCollapseToggle: false,
activeItem: 'portfolio',
items: [
{
value: 'portfolio',
label: 'Portfolio',
icon: 'pie-chart'
},
{
value: 'wallet',
label: 'Wallet',
icon: 'wallet'
},
{
value: 'activity',
label: 'Activity',
icon: 'chart-line'
},
{
value: 'billing',
label: 'Billing',
icon: 'receipt'
},
{
value: 'prefs',
label: 'Preferences',
icon: 'sliders'
},
{
value: 'help',
label: 'Help',
icon: 'help-circle'
}
]
}
const active = ref('portfolio')
const expanded = ref(null)
const collapsed = ref(false)
const wrapStyle = 'display:flex;align-items:flex-start;min-height:420px;padding:16px;background:var(--v-color-neutral-50);'
</script>
<template>
<div :style="wrapStyle"><VSidebar v-bind="args" v-model:activeItem="active" v-model:expandedSections="expanded" v-model:collapsed="collapsed" /></div>
</template>Floating
Variação Flutuante. Props: variant="floating", showSearch=false, heading="Canvas", position="Alex Chen · Workspace", brandName="Current". Interativo: o estado é mantido na própria story (v-model).
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const args = {
size: 'md',
brandName: 'Current',
userName: 'Alex Chen',
userEmail: 'alex@nova.dev',
variant: 'floating',
showSearch: false,
heading: 'Canvas',
position: 'Alex Chen · Workspace'
}
const collapsed = ref(false)
const locked = ref(false)
const active = ref('dashboard')
</script>
<template>
<div style="display:flex;align-items:flex-start;height:720px;padding:24px;background:var(--v-color-neutral-100);"><VSidebar v-bind="args" v-model:activeItem="active" v-model:collapsed="collapsed" v-model:locked="locked" /></div>
</template>Modes
Variação Modes. Interativo: o estado é mantido na própria story (v-model).
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const collapsed = ref(true)
const locked = ref(false)
const shared = {
showSearch: false,
heading: 'Canvas',
position: 'Alex Chen · Workspace',
brandName: 'Current'
}
const active = ref('dashboard')
</script>
<template>
<div style="display:flex;gap:24px;align-items:stretch;height:720px;padding:24px;background:var(--v-color-neutral-100);">
<VSidebar variant="floating" v-bind="shared" v-model:activeItem="active" v-model:collapsed="collapsed" v-model:locked="locked" />
<VSidebar v-bind="shared" v-model:activeItem="active" />
<VSidebar variant="floating" v-bind="shared" v-model:activeItem="active" locked />
<VSidebar variant="floating" v-bind="shared" v-model:activeItem="active" :collapsed="false" />
</div>
</template>Sizes
Variação Tamanhos. Interativo: o estado é mantido na própria story (v-model).
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const args = {
size: 'md',
brandName: 'VueUI Nova',
userName: 'Alex Chen',
userEmail: 'alex@nova.dev'
}
const active = ref('dashboard')
</script>
<template>
<div style="display: flex; gap: 16px; align-items: flex-start; min-height: 520px;">
<VSidebar v-bind="args" v-model:activeItem="active" size="sm" />
<VSidebar v-bind="args" v-model:activeItem="active" size="md" />
<VSidebar v-bind="args" v-model:activeItem="active" size="lg" />
</div>
</template>Nested
Variação Aninhado. Props: activeItem="overview".
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const args = {
size: 'md',
brandName: 'VueUI Nova',
userName: 'Alex Chen',
userEmail: 'alex@nova.dev',
activeItem: 'overview',
expandedSections: [
'team'
]
}
const active = ref('overview')
const expanded = ref([
'team'
])
const collapsed = ref(false)
const wrapStyle = 'display:flex;'
</script>
<template>
<div :style="wrapStyle"><VSidebar v-bind="args" v-model:activeItem="active" v-model:expandedSections="expanded" v-model:collapsed="collapsed" /></div>
</template>Disabled
Variação Desabilitado. Props: disabled=true.
Ver código
<script setup lang="ts">
import { VSidebar } from 'vueui-nova-kit'
</script>
<template>
<VSidebar v-model="value" disabled />
</template>Card Menu
Variação Card menu. Props: variant="card", brandName="Current", showSearch=false, showFooter=false, activeItem="home".
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const args = {
size: 'md',
brandName: 'Current',
userName: 'Alex Chen',
userEmail: 'alex@nova.dev',
variant: 'card',
showSearch: false,
showFooter: false,
activeItem: 'home',
items: [
{
value: 'home',
label: 'Home',
icon: 'home'
},
{
value: 'agent',
label: 'lemAgent',
icon: 'bot'
},
{
value: 'find',
label: 'Find & Manage',
type: 'heading'
},
{
value: 'people',
label: 'People database',
icon: 'users'
},
{
value: 'signals',
label: 'Signal agents',
icon: 'radar'
},
{
value: 'contacts',
label: 'Contacts',
icon: 'contact'
},
{
value: 'companies',
label: 'Companies',
icon: 'building'
},
{
value: 'engage',
label: 'Engage',
type: 'heading'
},
{
value: 'campaigns',
label: 'Campaigns',
icon: 'send'
},
{
value: 'tasks',
label: 'Tasks',
icon: 'check'
},
{
value: 'inbox',
label: 'Inbox',
icon: 'inbox'
}
]
}
const active = ref('home')
const expanded = ref(null)
const collapsed = ref(false)
const wrapStyle = 'display:flex;height:640px;background:var(--v-color-neutral-50);'
</script>
<template>
<div :style="wrapStyle"><VSidebar v-bind="args" v-model:activeItem="active" v-model:expandedSections="expanded" v-model:collapsed="collapsed" /></div>
</template>Workspace
Variação Workspace. Props: variant="workspace", showSearch=false, showFooter=false, brandName="FlowPilot AI", activeItem="templates".
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const args = {
size: 'md',
brandName: 'FlowPilot AI',
userName: 'Alex Chen',
userEmail: 'alex@nova.dev',
variant: 'workspace',
showSearch: false,
showFooter: false,
activeItem: 'templates',
items: [
{
value: 'workspace',
label: 'Workspace',
type: 'heading'
},
{
value: 'overview',
label: 'Overview',
icon: 'overview'
},
{
value: 'templates',
label: 'Templates',
icon: 'templates'
},
{
value: 'workflow',
label: 'Workflow Builder',
icon: 'workflow'
},
{
value: 'ai',
label: 'AI Configuration',
icon: 'ai'
},
{
value: 'test',
label: 'Test Run',
icon: 'play'
},
{
value: 'review',
label: 'Review Queue',
icon: 'inbox'
},
{
value: 'analytics',
label: 'Analytics',
icon: 'analytics'
},
{
value: 'operations',
label: 'Operations',
type: 'heading'
},
{
value: 'runs',
label: 'Runs & Logs',
icon: 'play'
},
{
value: 'exceptions',
label: 'Exceptions',
icon: 'exceptions'
},
{
value: 'connectors',
label: 'Connectors',
icon: 'connectors'
},
{
value: 'sources',
label: 'Data Sources',
icon: 'database'
},
{
value: 'admin',
label: 'Administration',
type: 'heading'
},
{
value: 'team',
label: 'Team & Permissions',
icon: 'team'
},
{
value: 'notifications',
label: 'Notifications',
icon: 'notifications',
badge: 78
},
{
value: 'billing',
label: 'Usage & Billing',
icon: 'billing'
},
{
value: 'audit',
label: 'Audit Log',
icon: 'file'
},
{
value: 'settings',
label: 'System Settings',
icon: 'settings'
}
]
}
const active = ref('templates')
const expanded = ref(null)
const collapsed = ref(false)
const wrapStyle = 'display:flex;align-items:flex-start;height:720px;background:var(--v-color-neutral-100);'
</script>
<template>
<div :style="wrapStyle"><VSidebar v-bind="args" v-model:activeItem="active" v-model:expandedSections="expanded" v-model:collapsed="collapsed" /></div>
</template>Multi Level
Variação Multi nível. Props: activeItem="perm-write", userName="Alex Chen".
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const args = {
size: 'md',
brandName: 'VueUI Nova',
userName: 'Alex Chen',
userEmail: 'alex@nova.dev',
items: [
{
value: 'g-main',
label: 'Main',
type: 'group',
children: [
{
value: 'dashboard',
label: 'Dashboard',
icon: 'home'
},
{
value: 'analytics',
label: 'Analytics',
icon: 'analytics',
children: [
{
value: 'h-reports',
label: 'Reports',
type: 'heading'
},
{
value: 'revenue',
label: 'Revenue'
},
{
value: 'retention',
label: 'Retention'
},
{
value: 'h-funnels',
label: 'Funnels',
type: 'heading'
},
{
value: 'acquisition',
label: 'Acquisition',
children: [
{
value: 'signup',
label: 'Sign-up flow'
},
{
value: 'checkout',
label: 'Checkout flow'
},
{
value: 'onboarding',
label: 'Onboarding',
badge: 4
}
]
},
{
value: 'cohorts',
label: 'Cohorts'
}
]
},
{
value: 'projects',
label: 'Projects',
icon: 'projects',
children: [
{
value: 'h-active',
label: 'Active',
type: 'heading'
},
{
value: 'atlas',
label: 'Atlas redesign'
},
{
value: 'nova',
label: 'Nova kit',
badge: 12
},
{
value: 'h-archived',
label: 'Archived',
type: 'heading'
},
{
value: 'legacy',
label: 'Legacy',
children: [
{
value: 'portal-v1',
label: 'Portal v1'
},
{
value: 'portal-v2',
label: 'Portal v2'
}
]
}
]
},
{
value: 'inbox',
label: 'Inbox',
icon: 'inbox',
badge: 8
}
]
},
{
value: 'g-team',
label: 'Team',
type: 'group',
children: [
{
value: 'team',
label: 'People',
icon: 'team',
children: [
{
value: 'members',
label: 'Members'
},
{
value: 'roles',
label: 'Roles'
},
{
value: 'permissions',
label: 'Permissions',
children: [
{
value: 'perm-read',
label: 'Read access'
},
{
value: 'perm-write',
label: 'Write access'
},
{
value: 'perm-admin',
label: 'Admin access'
}
]
},
{
value: 'invites',
label: 'Invitations'
}
]
},
{
value: 'calendar',
label: 'Calendar',
icon: 'calendar'
},
{
value: 'tasks',
label: 'My tasks',
icon: 'tasks',
badge: 3
}
]
},
{
value: 'g-system',
label: 'System',
type: 'group',
children: [
{
value: 'integrations',
label: 'Integrations',
icon: 'integrations',
children: [
{
value: 'slack',
label: 'Slack'
},
{
value: 'github',
label: 'GitHub'
},
{
value: 'figma',
label: 'Figma'
}
]
},
{
value: 'billing',
label: 'Billing',
icon: 'billing'
},
{
value: 'security',
label: 'Security',
icon: 'shield'
},
{
value: 'audit',
label: 'Audit log',
icon: 'file'
},
{
value: 'settings',
label: 'Settings',
icon: 'settings'
}
]
}
],
activeItem: 'perm-write'
}
const active = ref('perm-write')
const expanded = ref(null)
const collapsed = ref(false)
const wrapStyle = 'display:flex;height:640px;background:var(--v-color-bg);overflow:hidden;'
</script>
<template>
<div :style="wrapStyle"><VSidebar v-bind="args" v-model:activeItem="active" v-model:expandedSections="expanded" v-model:collapsed="collapsed" /></div>
</template>Accordion
Variação Acordeão. Esquerda: accordion (padrão), abrir uma seção fecha as irmãs. Direita: :accordion="false", as seções abrem de forma independente. Inclui interação automatizada (play).
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const items = [
{
value: 'home',
label: 'Home',
icon: 'home'
},
{
value: 'products',
label: 'Products',
icon: 'folder',
children: [
{
value: 'catalog',
label: 'Catalog'
},
{
value: 'pricing',
label: 'Pricing'
},
{
value: 'variants',
label: 'Variants',
children: [
{
value: 'sizes',
label: 'Sizes'
},
{
value: 'colors',
label: 'Colors'
}
]
}
]
},
{
value: 'orders',
label: 'Orders',
icon: 'send',
children: [
{
value: 'open',
label: 'Open'
},
{
value: 'shipped',
label: 'Shipped'
},
{
value: 'returns',
label: 'Returns'
}
]
},
{
value: 'customers',
label: 'Customers',
icon: 'users',
children: [
{
value: 'segments',
label: 'Segments'
},
{
value: 'reviews',
label: 'Reviews'
}
]
},
{
value: 'reports',
label: 'Reports',
icon: 'chart',
children: [
{
value: 'sales',
label: 'Sales'
},
{
value: 'traffic',
label: 'Traffic'
}
]
}
]
const frame = 'display:flex;height:520px;background:var(--v-color-bg);overflow:hidden;'
const activeA = ref('catalog')
const activeB = ref('catalog')
const expA = ref([
'products'
])
const expB = ref([
'products'
])
</script>
<template>
<div :style="frame + 'gap:24px;padding:0 24px;background:var(--v-color-neutral-100)'">
<VSidebar :items="items" :show-footer="false" :show-search="false" v-model:expandedSections="expA" v-model:activeItem="activeA" />
<VSidebar :items="items" :accordion="false" :show-footer="false" :show-search="false" v-model:expandedSections="expB" v-model:activeItem="activeB" />
</div>
</template>Search Filter
Variação Busca filtro. Props: activeItem="dashboard", searchPlaceholder="Search menu…", searchShortcut="/". Inclui interação automatizada (play).
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const args = {
size: 'md',
brandName: 'VueUI Nova',
userName: 'Alex Chen',
userEmail: 'alex@nova.dev',
items: [
{
value: 'g-main',
label: 'Main',
type: 'group',
children: [
{
value: 'dashboard',
label: 'Dashboard',
icon: 'home'
},
{
value: 'analytics',
label: 'Analytics',
icon: 'analytics',
children: [
{
value: 'h-reports',
label: 'Reports',
type: 'heading'
},
{
value: 'revenue',
label: 'Revenue'
},
{
value: 'retention',
label: 'Retention'
},
{
value: 'h-funnels',
label: 'Funnels',
type: 'heading'
},
{
value: 'acquisition',
label: 'Acquisition',
children: [
{
value: 'signup',
label: 'Sign-up flow'
},
{
value: 'checkout',
label: 'Checkout flow'
},
{
value: 'onboarding',
label: 'Onboarding',
badge: 4
}
]
},
{
value: 'cohorts',
label: 'Cohorts'
}
]
},
{
value: 'projects',
label: 'Projects',
icon: 'projects',
children: [
{
value: 'h-active',
label: 'Active',
type: 'heading'
},
{
value: 'atlas',
label: 'Atlas redesign'
},
{
value: 'nova',
label: 'Nova kit',
badge: 12
},
{
value: 'h-archived',
label: 'Archived',
type: 'heading'
},
{
value: 'legacy',
label: 'Legacy',
children: [
{
value: 'portal-v1',
label: 'Portal v1'
},
{
value: 'portal-v2',
label: 'Portal v2'
}
]
}
]
},
{
value: 'inbox',
label: 'Inbox',
icon: 'inbox',
badge: 8
}
]
},
{
value: 'g-team',
label: 'Team',
type: 'group',
children: [
{
value: 'team',
label: 'People',
icon: 'team',
children: [
{
value: 'members',
label: 'Members'
},
{
value: 'roles',
label: 'Roles'
},
{
value: 'permissions',
label: 'Permissions',
children: [
{
value: 'perm-read',
label: 'Read access'
},
{
value: 'perm-write',
label: 'Write access'
},
{
value: 'perm-admin',
label: 'Admin access'
}
]
},
{
value: 'invites',
label: 'Invitations'
}
]
},
{
value: 'calendar',
label: 'Calendar',
icon: 'calendar'
},
{
value: 'tasks',
label: 'My tasks',
icon: 'tasks',
badge: 3
}
]
},
{
value: 'g-system',
label: 'System',
type: 'group',
children: [
{
value: 'integrations',
label: 'Integrations',
icon: 'integrations',
children: [
{
value: 'slack',
label: 'Slack'
},
{
value: 'github',
label: 'GitHub'
},
{
value: 'figma',
label: 'Figma'
}
]
},
{
value: 'billing',
label: 'Billing',
icon: 'billing'
},
{
value: 'security',
label: 'Security',
icon: 'shield'
},
{
value: 'audit',
label: 'Audit log',
icon: 'file'
},
{
value: 'settings',
label: 'Settings',
icon: 'settings'
}
]
}
],
activeItem: 'dashboard',
searchPlaceholder: 'Search menu…',
searchShortcut: '/'
}
const active = ref('dashboard')
const expanded = ref(null)
const collapsed = ref(false)
const wrapStyle = 'display:flex;height:640px;background:var(--v-color-bg);overflow:hidden;'
</script>
<template>
<div :style="wrapStyle"><VSidebar v-bind="args" v-model:activeItem="active" v-model:expandedSections="expanded" v-model:collapsed="collapsed" /></div>
</template>Workspace Starline
Workspace completo (Starline): segue o tema claro/escuro da página. Slots usados: #group-actions, #header, #after-nav, #footer. Recolhido, o #header mostra só a marca (escopo { collapsed }) e o rodapé empilha os atalhos no eixo do rail.
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VButton, VIcon, VSidebar } from 'vueui-nova-kit'
const items = [
{
value: 'home',
label: 'Home',
icon: 'home'
},
{
value: 'updates',
label: 'Updates',
icon: 'bell',
badge: 44
},
{
value: 'inbox',
label: 'Inbox',
icon: 'inbox',
badge: 20
},
{
value: 'my-tasks',
label: 'My tasks',
icon: 'tasks',
badge: '+'
},
{
value: 'g-workspace',
label: 'Workspace',
type: 'group',
children: [
{
value: 'planejamento',
label: 'Planejamento',
icon: 'chart',
children: [
{
value: 'q1',
label: 'Q1 planning'
},
{
value: 'q2',
label: 'Q2 planning'
}
]
},
{
value: 'cycles',
label: 'Cycles',
icon: 'activity'
}
]
},
{
value: 'g-projects',
label: 'Projects',
type: 'group',
children: [
{
value: 'p-atlas',
label: 'Atlas',
iconColor: 'var(--v-color-primary-500)',
children: [
{
value: 'atlas-mar',
label: 'March',
badge: 23
},
{
value: 'atlas-apr',
label: 'April',
badge: 99
}
]
},
{
value: 'p-orbit',
label: 'Orbit',
iconColor: 'var(--v-color-success-base)',
children: [
{
value: 'orbit-mar',
label: 'March',
badge: 7
},
{
value: 'orbit-apr',
label: 'April',
badge: 12
}
]
},
{
value: 'p-lumen',
label: 'Lumen',
iconColor: 'var(--v-color-orange-base)',
children: [
{
value: 'lumen-all',
label: 'All issues',
badge: 31
}
]
},
{
value: 'p-pulse',
label: 'Pulse',
iconColor: 'var(--v-color-pink-base)',
badge: 5
}
]
}
]
const icons = {
moreIcon: {
width: 24,
height: 24,
body: '<path fill=\'currentColor\' d=\'M7 12C7 13.1045 6.1045 14 5 14C3.8955 14 3 13.1045 3 12C3 10.8955 3.8955 10 5 10C6.1045 10 7 10.8955 7 12ZM14 12C14 13.1045 13.1045 14 12 14C10.8955 14 10 13.1045 10 12C10 10.8955 10.8955 10 12 10C13.1045 10 14 10.8955 14 12ZM21 12C21 13.1045 20.1045 14 19 14C17.8955 14 17 13.1045 17 12C17 10.8955 17.8955 10 19 10C20.1045 10 21 10.8955 21 12Z\'/>'
},
plusIcon: {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 12H19M11.995 19.005V5.005\'/>'
},
homeIcon: {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M20.2928 9.4009L13.2928 3.4703C12.5468 2.8383 11.4532 2.8383 10.7072 3.4703L3.7072 9.4009C3.2586 9.7809 3 10.339 3 10.9268L3 19C3 20.1046 3.8954 21 5 21L19 21C20.1046 21 21 20.1046 21 19L21 10.9268C21 10.339 20.7414 9.7809 20.2928 9.4009ZM9 21V14H15V21\'/>'
},
inboxIcon: {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M8.6794 4L15.3206 4C16.364 4 17.3325 4.5422 17.878 5.4317L21.5574 11.4317C21.8468 11.9036 22 12.4464 22 13L22 17C22 18.6569 20.6569 20 19 20L5 20C3.3431 20 2 18.6569 2 17L2 13C2 12.4464 2.1532 11.9036 2.4426 11.4317L6.122 5.4317C6.6675 4.5422 7.636 4 8.6794 4ZM2 13L8 13L10 16L14 16L16 13L22 13\'/>'
},
searchIcon: {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M17 10C17 13.866 13.866 17 10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10ZM15 15L21 21\'/>'
},
folderIcon: {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M3 7C3 5.3431 4.3431 4 6 4L8.6716 4C9.202 4 9.7107 4.2107 10.0858 4.5858L11.4142 5.9142C11.7893 6.2893 12.298 6.5 12.8284 6.5L18 6.5C19.6569 6.5 21 7.8431 21 9.5L21 17C21 18.6569 19.6569 20 18 20L6 20C4.3431 20 3 18.6569 3 17Z\'/>'
},
settingsIcon: {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M9.8826 3.31L9.6447 5.26C9.5876 5.73 9.3203 6.14 8.9222 6.37L8.7712 6.46C8.3732 6.7 7.8905 6.73 7.467 6.55L5.6993 5.78C5.0174 5.49 4.228 5.76 3.8579 6.41L3.1967 7.59C2.8267 8.24 2.9918 9.07 3.5819 9.53L5.1117 10.71C5.4781 11 5.6935 11.44 5.6935 11.91V12.09C5.6935 12.56 5.4781 13 5.1117 13.29L3.5819 14.47C2.9918 14.93 2.8267 15.76 3.1967 16.41L3.8579 17.59C4.228 18.24 5.0174 18.51 5.6993 18.22L7.467 17.45C7.8905 17.27 8.3732 17.3 8.7712 17.54L8.9222 17.63C9.3203 17.86 9.5876 18.27 9.6447 18.74L9.8826 20.69C9.9744 21.44 10.5987 22 11.3388 22H12.6612C13.4013 22 14.0256 21.44 14.1173 20.69L14.3554 18.74C14.4124 18.27 14.6798 17.86 15.0778 17.63L15.2287 17.54C15.6268 17.3 16.1095 17.27 16.5329 17.45L18.3007 18.22C18.9826 18.51 19.772 18.24 20.1421 17.59L20.8033 16.41C21.1733 15.76 21.0082 14.93 20.4181 14.47L18.8883 13.29C18.5219 13 18.3066 12.56 18.3066 12.09V11.91C18.3066 11.44 18.5219 11 18.8883 10.71L20.4181 9.53C21.0082 9.07 21.1733 8.24 20.8033 7.59L20.1421 6.41C19.772 5.76 18.9826 5.49 18.3007 5.78L16.5329 6.55C16.1095 6.73 15.6268 6.7 15.2287 6.46L15.0778 6.37C14.6798 6.14 14.4124 5.73 14.3554 5.26L14.1173 3.31C14.0256 2.56 13.4013 2 12.6612 2H11.3388C10.5987 2 9.9744 2.56 9.8826 3.31ZM12 9.5C13.3807 9.5 14.5 10.6193 14.5 12C14.5 13.3807 13.3807 14.5 12 14.5C10.6193 14.5 9.5 13.3807 9.5 12C9.5 10.6193 10.6193 9.5 12 9.5Z\'/>'
},
sparklesIcon: {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M15.4651 9.1794L16.7409 12.4141C16.8933 12.8006 17.1994 13.1067 17.5859 13.2591L20.8206 14.5349C21.0117 14.6102 21.1372 14.7947 21.1372 15C21.1372 15.2053 21.0117 15.3898 20.8206 15.4651L17.5859 16.7409C17.1994 16.8933 16.8933 17.1994 16.7409 17.5859L15.4651 20.8206C15.3898 21.0117 15.2053 21.1372 15 21.1372C14.7947 21.1372 14.6102 21.0117 14.5349 20.8206L13.2591 17.5859C13.1067 17.1994 12.8006 16.8933 12.4141 16.7409L9.1794 15.4651C8.9883 15.3898 8.8628 15.2053 8.8628 15C8.8628 14.7947 8.9883 14.6102 9.1794 14.5349L12.4141 13.2591C12.8006 13.1067 13.1067 12.8006 13.2591 12.4141L14.5349 9.1794C14.6102 8.9883 14.7947 8.8628 15 8.8628C15.2053 8.8628 15.3898 8.9883 15.4651 9.1794ZM6.7151 3.1794L7.2131 4.4419C7.3655 4.8285 7.6715 5.1345 8.0581 5.2869L9.3206 5.7849C9.5117 5.8602 9.6372 6.0447 9.6372 6.25C9.6372 6.4553 9.5117 6.6398 9.3206 6.7151L8.0581 7.2131C7.6715 7.3655 7.3655 7.6715 7.2131 8.0581L6.7151 9.3206C6.6398 9.5117 6.4553 9.6372 6.25 9.6372C6.0447 9.6372 5.8602 9.5117 5.7849 9.3206L5.2869 8.0581C5.1345 7.6715 4.8285 7.3655 4.4419 7.2131L3.1794 6.7151C2.9883 6.6398 2.8628 6.4553 2.8628 6.25C2.8628 6.0447 2.9883 5.8602 3.1794 5.7849L4.4419 5.2869C4.8285 5.1345 5.1345 4.8285 5.2869 4.4419L5.7849 3.1794C5.8602 2.9883 6.0447 2.8628 6.25 2.8628C6.4553 2.8628 6.6398 2.9883 6.7151 3.1794Z\'/>'
},
bellIcon: {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M12 3C14.7614 3 17 5.23858 17 8C17 13 19 14 19 15C19 15.5523 18.5523 16 18 16H6C5.44772 16 5 15.5523 5 15C5 14 7 13 7 8C7 5.23858 9.23858 3 12 3ZM10.2679 20C10.6252 20.6188 11.2855 21 12 21C12.7145 21 13.3748 20.6188 13.7321 20\'/>'
},
panelLeftIcon: {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M6 3H18C19.6569 3 21 4.34315 21 6V18C21 19.6569 19.6569 21 18 21H6C4.34315 21 3 19.6569 3 18V6C3 4.34315 4.34315 3 6 3ZM9 3V21\'/>'
},
chevronsUpDownIcon: {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M7 9L12 4L17 9M7 15L12 20L17 15\'/>'
},
helpIcon: {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M4 4L8 4C10.2091 4 12 5.7909 12 8C12 5.7909 13.7909 4 16 4L20 4C21.1046 4 22 4.8954 22 6L22 15C22 16.1046 21.1046 17 20 17L15 17C13.3431 17 12 18.3431 12 20C12 18.3431 10.6569 17 9 17L4 17C2.8954 17 2 16.1046 2 15L2 6C2 4.8954 2.8954 4 4 4ZM12 8L12 20\'/>'
}
}
const frame = 'display:flex;height:800px;background:var(--v-color-bg);overflow:hidden;'
const active = ref('atlas-mar')
const expanded = ref([
'g-workspace',
'g-projects',
'p-atlas'
])
const collapsed = ref(false)
</script>
<template>
<div :style="frame + 'color:var(--v-color-text)'">
<nav aria-label="Apps" style="width:44px;flex:none;display:flex;flex-direction:column;align-items:center;gap:6px;padding:14px 0;border-right:1px solid var(--v-color-divider);background:var(--v-color-bg)">
<span style="width:26px;height:26px;border-radius:8px;background:linear-gradient(135deg,var(--v-color-primary-400),var(--v-color-primary-700));margin-bottom:8px"></span>
<VButton v-for="i in [icons.homeIcon, icons.folderIcon, icons.inboxIcon, icons.sparklesIcon]" :key="i.body" variant="ghost" size="sm" aria-label="Atalho do rail"><template #icon><VIcon :icon="i" size="sm" /></template></VButton>
<span style="flex:1"></span>
<VButton variant="ghost" size="sm" aria-label="Configurações"><template #icon><VIcon :icon="icons.settingsIcon" size="sm" /></template></VButton>
</nav>
<VSidebar :items="items" :width="216" group-chevron="start" group-dividers chevron="updown" v-model:activeItem="active" v-model:expandedSections="expanded" v-model:collapsed="collapsed" search-placeholder="Command" search-shortcut="/" show-footer>
<template #group-actions="{ group }">
<VButton variant="ghost" size="sm" :aria-label="'More options for ' + group.label"><template #icon><VIcon :icon="icons.moreIcon" size="sm" /></template></VButton>
<VButton variant="ghost" size="sm" :aria-label="'Add to ' + group.label"><template #icon><VIcon :icon="icons.plusIcon" size="sm" /></template></VButton>
</template>
<template #header="{ collapsed: isCollapsed, toggle }">
<span style="width:20px;height:20px;border-radius:6px;background:linear-gradient(135deg,var(--v-color-primary-400),var(--v-color-primary-700));flex:none"></span>
<template v-if="!isCollapsed">
<span style="flex:1;font-size:13px;font-weight:600;color:var(--v-color-text)">Starline AI</span>
<VIcon :icon="icons.chevronsUpDownIcon" size="sm" style="color:var(--v-color-text-muted)" />
<VButton variant="ghost" size="sm" aria-label="Collapse sidebar" @click="toggle"><template #icon><VIcon :icon="icons.panelLeftIcon" size="sm" /></template></VButton>
</template>
</template>
<template #after-nav>
<div style="border:1px solid var(--v-color-divider);border-radius:12px;overflow:hidden;background:var(--v-color-neutral-50)">
<div style="height:48px;background:linear-gradient(120deg,var(--v-color-primary-700),var(--v-color-primary-500) 60%,var(--v-color-primary-300))"></div>
<div style="padding:10px 12px 12px;display:grid;gap:8px">
<span style="font-size:12px;color:var(--v-color-text-muted);line-height:16px">Unlock unlimited projects and AI triage.</span>
<VButton variant="inverse" size="sm">Upgrade Plan</VButton>
</div>
</div>
</template>
<template #footer="{ collapsed: isCollapsed }">
<div :style="{ display: 'flex', flexDirection: isCollapsed ? 'column' : 'row', alignItems: 'center', gap: '4px' }">
<VButton v-for="i in [icons.helpIcon, icons.bellIcon, icons.settingsIcon]" :key="i.body" variant="ghost" size="sm" aria-label="Atalho do rodapé"><template #icon><VIcon :icon="i" size="sm" /></template></VButton>
</div>
</template>
</VSidebar>
<main style="flex:1"></main>
</div>
</template>Portfólio
Variação Portfólio (segue o tema da página). Interativo: o estado é mantido na própria story (v-model). Slots usados: #after-nav.
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar, VButton } from 'vueui-nova-kit'
const items = [
{
value: 'g-portfolio',
label: 'Portfolio',
type: 'group',
collapsible: false,
children: [
{
value: 'overview',
label: 'Overview',
icon: 'overview'
},
{
value: 'holdings',
label: 'Holdings',
icon: 'folder'
},
{
value: 'performance',
label: 'Performance',
icon: 'trending',
children: [
{
value: 'returns',
label: 'Returns'
},
{
value: 'benchmarks',
label: 'Benchmarks'
}
]
}
]
},
{
value: 'g-operations',
label: 'Operations',
type: 'group',
collapsible: false,
children: [
{
value: 'rebalancing',
label: 'Rebalancing',
icon: 'workflow'
},
{
value: 'orders',
label: 'Orders',
icon: 'send'
},
{
value: 'compliance',
label: 'Compliance',
icon: 'shield',
tag: 'Soon',
disabled: true
},
{
value: 'tax',
label: 'Tax harvesting',
icon: 'wallet',
tag: 'Soon',
disabled: true
}
]
},
{
value: 'g-queue',
label: 'Execution queue',
type: 'group',
collapsible: false,
children: [
{
value: 'pending',
label: 'Pending',
icon: 'clock',
badge: 6
},
{
value: 'scheduled',
label: 'Scheduled',
icon: 'calendar'
},
{
value: 'failed',
label: 'Failed',
icon: 'alert',
tag: 'Soon',
disabled: true
}
]
}
]
const frame = 'display:flex;height:720px;background:var(--v-color-bg);overflow:hidden;'
const active = ref('rebalancing')
const expanded = ref([
'performance'
])
</script>
<template>
<div :style="frame">
<VSidebar :width="216" style="--v-sidebar-item-active-bg:var(--v-color-neutral-100);--v-sidebar-item-active-color:var(--v-color-text);--v-sidebar-accent:var(--v-color-text)" :items="items" v-model:activeItem="active" v-model:expandedSections="expanded" brand-name="Locally inc." search-placeholder="Search" search-shortcut="⌘K" user-name="Marta Silva" user-email="marta@locally.io" user-avatar="MS">
<template #after-nav>
<div style="border:1px solid var(--v-sidebar-border);border-radius:12px;padding:12px;display:grid;gap:8px;background:var(--v-color-neutral-50)">
<strong style="font-size:13px;color:var(--v-color-text)">AI Rebalancer</strong>
<span style="font-size:11px;line-height:16px;color:var(--v-color-text-muted)">3 drift alerts are ready to review before market open.</span>
<VButton variant="inverse" size="sm">Review</VButton>
</div>
</template>
</VSidebar>
<main style="flex:1"></main>
</div>
</template>Collapsible Groups
Variação Recolhível grupos. Props: activeItem="appointments", brandName="CareOps", size="lg".
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const args = {
size: 'lg',
brandName: 'CareOps',
userName: 'Alex Chen',
userEmail: 'alex@nova.dev',
items: [
{
value: 'g-menu',
label: 'Menu',
type: 'group',
children: [
{
value: 'dash',
label: 'Dashboard',
icon: 'home'
},
{
value: 'appointments',
label: 'Appointments',
icon: 'calendar',
badge: 10,
badgeTone: 'primary'
},
{
value: 'patients',
label: 'Patients',
icon: 'users'
},
{
value: 'messages',
label: 'Messages',
icon: 'message',
badge: 3,
badgeTone: 'primary'
}
]
},
{
value: 'g-business',
label: 'Business',
type: 'group',
children: [
{
value: 'finance',
label: 'Finance',
icon: 'wallet',
children: [
{
value: 'invoices',
label: 'Invoices'
},
{
value: 'payouts',
label: 'Payouts'
}
]
},
{
value: 'staff',
label: 'Staff',
icon: 'team'
},
{
value: 'reports',
label: 'Reports',
icon: 'chart'
}
]
},
{
value: 'g-support',
label: 'Support',
type: 'group',
defaultOpen: false,
children: [
{
value: 'help',
label: 'Help center',
icon: 'book'
},
{
value: 'status',
label: 'System status',
icon: 'activity'
}
]
}
],
activeItem: 'appointments',
showSearch: false
}
const active = ref('appointments')
const expanded = ref(null)
const collapsed = ref(false)
const wrapStyle = 'display:flex;height:640px;background:var(--v-color-bg);overflow:hidden;'
</script>
<template>
<div :style="wrapStyle"><VSidebar v-bind="args" v-model:activeItem="active" v-model:expandedSections="expanded" v-model:collapsed="collapsed" group-chevron-open="up" /></div>
</template>Chevron Styles
Estilos de chevron, da esquerda para a direita: chevron="rotate" + groupChevron="end" (padrão); chevron="updown" + groupChevronOpen="up" ("v" fechado, "^" aberto); groupChevron="start" (chevron do grupo antes da legenda).
Ver código
<script setup lang="ts">
import { VSidebar } from 'vueui-nova-kit'
const careOpsItems = [
{
value: 'g-menu',
label: 'Menu',
type: 'group',
children: [
{
value: 'dash',
label: 'Dashboard',
icon: 'home'
},
{
value: 'appointments',
label: 'Appointments',
icon: 'calendar',
badge: 10,
badgeTone: 'primary'
},
{
value: 'patients',
label: 'Patients',
icon: 'users'
},
{
value: 'messages',
label: 'Messages',
icon: 'message',
badge: 3,
badgeTone: 'primary'
}
]
},
{
value: 'g-business',
label: 'Business',
type: 'group',
children: [
{
value: 'finance',
label: 'Finance',
icon: 'wallet',
children: [
{
value: 'invoices',
label: 'Invoices'
},
{
value: 'payouts',
label: 'Payouts'
}
]
},
{
value: 'staff',
label: 'Staff',
icon: 'team'
},
{
value: 'reports',
label: 'Reports',
icon: 'chart'
}
]
},
{
value: 'g-support',
label: 'Support',
type: 'group',
defaultOpen: false,
children: [
{
value: 'help',
label: 'Help center',
icon: 'book'
},
{
value: 'status',
label: 'System status',
icon: 'activity'
}
]
}
]
const accordionItems = [
{
value: 'home',
label: 'Home',
icon: 'home'
},
{
value: 'products',
label: 'Products',
icon: 'folder',
children: [
{
value: 'catalog',
label: 'Catalog'
},
{
value: 'pricing',
label: 'Pricing'
},
{
value: 'variants',
label: 'Variants',
children: [
{
value: 'sizes',
label: 'Sizes'
},
{
value: 'colors',
label: 'Colors'
}
]
}
]
},
{
value: 'orders',
label: 'Orders',
icon: 'send',
children: [
{
value: 'open',
label: 'Open'
},
{
value: 'shipped',
label: 'Shipped'
},
{
value: 'returns',
label: 'Returns'
}
]
},
{
value: 'customers',
label: 'Customers',
icon: 'users',
children: [
{
value: 'segments',
label: 'Segments'
},
{
value: 'reviews',
label: 'Reviews'
}
]
},
{
value: 'reports',
label: 'Reports',
icon: 'chart',
children: [
{
value: 'sales',
label: 'Sales'
},
{
value: 'traffic',
label: 'Traffic'
}
]
}
]
const frame = 'display:flex;height:460px;background:var(--v-color-bg);overflow:hidden;'
const combos = [
{
id: 'rotate-end',
chevron: 'rotate',
groupChevron: 'end',
groupChevronOpen: 'down'
},
{
id: 'updown-up',
chevron: 'updown',
groupChevron: 'end',
groupChevronOpen: 'up'
},
{
id: 'group-start',
chevron: 'rotate',
groupChevron: 'start',
groupChevronOpen: 'down'
}
]
</script>
<template>
<div :style="frame + 'gap:16px;padding:0 16px;overflow-x:auto;background:var(--v-color-neutral-100)'">
<VSidebar v-for="c in combos" :key="c.id" :items="careOpsItems" :show-footer="false" :show-search="false" :chevron="c.chevron" :group-chevron="c.groupChevron" :group-chevron-open="c.groupChevronOpen" active-item="appointments" />
</div>
</template>Custom Width
width define a largura do painel (número = px; string = qualquer comprimento CSS) via --v-sidebar-width. Esquerda: 240; direita: "22rem".
Ver código
<script setup lang="ts">
import { VSidebar } from 'vueui-nova-kit'
const accordionItems = [
{
value: 'home',
label: 'Home',
icon: 'home'
},
{
value: 'products',
label: 'Products',
icon: 'folder',
children: [
{
value: 'catalog',
label: 'Catalog'
},
{
value: 'pricing',
label: 'Pricing'
},
{
value: 'variants',
label: 'Variants',
children: [
{
value: 'sizes',
label: 'Sizes'
},
{
value: 'colors',
label: 'Colors'
}
]
}
]
},
{
value: 'orders',
label: 'Orders',
icon: 'send',
children: [
{
value: 'open',
label: 'Open'
},
{
value: 'shipped',
label: 'Shipped'
},
{
value: 'returns',
label: 'Returns'
}
]
},
{
value: 'customers',
label: 'Customers',
icon: 'users',
children: [
{
value: 'segments',
label: 'Segments'
},
{
value: 'reviews',
label: 'Reviews'
}
]
},
{
value: 'reports',
label: 'Reports',
icon: 'chart',
children: [
{
value: 'sales',
label: 'Sales'
},
{
value: 'traffic',
label: 'Traffic'
}
]
}
]
const frame = 'display:flex;height:420px;background:var(--v-color-bg);overflow:hidden;'
</script>
<template>
<div :style="frame + 'gap:24px;padding:0 16px;background:var(--v-color-neutral-100)'">
<VSidebar :items="accordionItems" :show-footer="false" :show-search="false" :width="240" />
<VSidebar :items="accordionItems" :show-footer="false" :show-search="false" width="22rem" />
</div>
</template>Group Dividers
groupDividers adiciona uma linha fina acima de cada grupo, exceto o primeiro.
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const args = {
size: 'md',
brandName: 'VueUI Nova',
userName: 'Alex Chen',
userEmail: 'alex@nova.dev',
items: [
{
value: 'g-menu',
label: 'Menu',
type: 'group',
children: [
{
value: 'dash',
label: 'Dashboard',
icon: 'home'
},
{
value: 'appointments',
label: 'Appointments',
icon: 'calendar',
badge: 10,
badgeTone: 'primary'
},
{
value: 'patients',
label: 'Patients',
icon: 'users'
},
{
value: 'messages',
label: 'Messages',
icon: 'message',
badge: 3,
badgeTone: 'primary'
}
]
},
{
value: 'g-business',
label: 'Business',
type: 'group',
children: [
{
value: 'finance',
label: 'Finance',
icon: 'wallet',
children: [
{
value: 'invoices',
label: 'Invoices'
},
{
value: 'payouts',
label: 'Payouts'
}
]
},
{
value: 'staff',
label: 'Staff',
icon: 'team'
},
{
value: 'reports',
label: 'Reports',
icon: 'chart'
}
]
},
{
value: 'g-support',
label: 'Support',
type: 'group',
defaultOpen: false,
children: [
{
value: 'help',
label: 'Help center',
icon: 'book'
},
{
value: 'status',
label: 'System status',
icon: 'activity'
}
]
}
],
groupDividers: true,
showSearch: false,
showFooter: false,
activeItem: 'appointments'
}
const active = ref('appointments')
const expanded = ref(null)
const collapsed = ref(false)
const wrapStyle = 'display:flex;height:480px;background:var(--v-color-bg);overflow:hidden;'
</script>
<template>
<div :style="wrapStyle"><VSidebar v-bind="args" v-model:activeItem="active" v-model:expandedSections="expanded" v-model:collapsed="collapsed" /></div>
</template>Item Trailing Slot
Slot #item-trailing="{ item }": conteúdo à direita de cada item (aqui, ação de adicionar nos itens com filhos). Também é possível trocar #header, #before-nav, #after-nav e #footer.
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar, VButton } from 'vueui-nova-kit'
const accordionItems = [
{
value: 'home',
label: 'Home',
icon: 'home'
},
{
value: 'products',
label: 'Products',
icon: 'folder',
children: [
{
value: 'catalog',
label: 'Catalog'
},
{
value: 'pricing',
label: 'Pricing'
},
{
value: 'variants',
label: 'Variants',
children: [
{
value: 'sizes',
label: 'Sizes'
},
{
value: 'colors',
label: 'Colors'
}
]
}
]
},
{
value: 'orders',
label: 'Orders',
icon: 'send',
children: [
{
value: 'open',
label: 'Open'
},
{
value: 'shipped',
label: 'Shipped'
},
{
value: 'returns',
label: 'Returns'
}
]
},
{
value: 'customers',
label: 'Customers',
icon: 'users',
children: [
{
value: 'segments',
label: 'Segments'
},
{
value: 'reviews',
label: 'Reviews'
}
]
},
{
value: 'reports',
label: 'Reports',
icon: 'chart',
children: [
{
value: 'sales',
label: 'Sales'
},
{
value: 'traffic',
label: 'Traffic'
}
]
}
]
const frame = 'display:flex;height:420px;background:var(--v-color-bg);overflow:hidden;'
const active = ref('catalog')
const expanded = ref([
'products'
])
</script>
<template>
<div :style="frame + 'gap:16px;padding:0 16px;background:var(--v-color-neutral-100)'">
<VSidebar :items="accordionItems" :show-footer="false" :show-search="false" v-model:activeItem="active" v-model:expandedSections="expanded">
<template #item-trailing="{ item }">
<VButton v-if="item.hasChildren" variant="ghost" size="sm" aria-label="Adicionar" @click.stop>+</VButton>
</template>
</VSidebar>
</div>
</template>Controlled Expanded Sections
Com expandedSections controlado (v-model:expandedSections), liste todos os ids de grupos/itens abertos; aqui começam abertos products e orders. Cada abertura/fechamento também emite section-toggle(value, expanded).
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const accordionItems = [
{
value: 'home',
label: 'Home',
icon: 'home'
},
{
value: 'products',
label: 'Products',
icon: 'folder',
children: [
{
value: 'catalog',
label: 'Catalog'
},
{
value: 'pricing',
label: 'Pricing'
},
{
value: 'variants',
label: 'Variants',
children: [
{
value: 'sizes',
label: 'Sizes'
},
{
value: 'colors',
label: 'Colors'
}
]
}
]
},
{
value: 'orders',
label: 'Orders',
icon: 'send',
children: [
{
value: 'open',
label: 'Open'
},
{
value: 'shipped',
label: 'Shipped'
},
{
value: 'returns',
label: 'Returns'
}
]
},
{
value: 'customers',
label: 'Customers',
icon: 'users',
children: [
{
value: 'segments',
label: 'Segments'
},
{
value: 'reviews',
label: 'Reviews'
}
]
},
{
value: 'reports',
label: 'Reports',
icon: 'chart',
children: [
{
value: 'sales',
label: 'Sales'
},
{
value: 'traffic',
label: 'Traffic'
}
]
}
]
const frame = 'display:flex;height:460px;background:var(--v-color-bg);overflow:hidden;'
const expanded = ref([
'products',
'orders'
])
const active = ref('open')
</script>
<template>
<div :style="frame + 'gap:16px;padding:0 16px;background:var(--v-color-neutral-100)'">
<VSidebar :items="accordionItems" :accordion="false" :show-footer="false" :show-search="false" v-model:activeItem="active" v-model:expandedSections="expanded" />
</div>
</template>Montagem · Rail de ícones
Rail de apps do Sales Overview: variant="icons" (itens 40×40, raio 12, ativo em primary 14%; a classe sp-app-rail só adiciona espaçamento e sticky). label vira title + aria-label; icon é um nome do registro interno do VSidebar.
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const items = [
{
value: 'globe',
label: 'Sites',
icon: 'globe'
},
{
value: 'chart',
label: 'Analytics',
icon: 'chart'
},
{
value: 'chat',
label: 'Conversations',
icon: 'chat'
},
{
value: 'file',
label: 'Documents',
icon: 'file'
},
{
value: 'nodes',
label: 'Automations',
icon: 'workflow'
},
{
value: 'settings',
label: 'Settings',
icon: 'settings'
}
]
const rail = ref('chart')
const page = 'display:flex;min-height:100vh;background:var(--v-color-bg);color:var(--v-color-text);font-family:var(--v-font-family-sans);'
</script>
<template>
<div :style="page"><VSidebar v-model:active-item="rail" class="sp-app-rail" variant="icons" :items="items" :show-search="false" :show-footer="false" :show-brand="false" :show-collapse-toggle="false" aria-label="Apps" /></div>
</template>Montagem · Rail expansível (ícones ⇄ textos)
Rail do Insights Detail: VSidebar recolhido (v-model:collapsed) que expande para ícones + textos pelo botão do próprio componente. O #header substitui a marca e o toggle inline, por isso recebe { collapsed, toggle } e traz o botão de recolher; o rodapé usa VNavItem (ícone no slot #icon) com VTooltip quando recolhido.
Ver código
<script setup lang="ts">
import { VSidebar } from 'vueui-nova-kit'
</script>
<template>
<VSidebar v-model="value" />
</template>Montagem · Menu com grupos e submenus
Menu do Sales Overview sem o seletor: <aside class="sp-side"> (248px, bordas laterais) com VSidebar.sp-side__nav. type: "group" cria a seção; item com children vira submenu; expandedSections lista os value abertos.
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar } from 'vueui-nova-kit'
const items = [
{
value: 'overview',
label: 'Overview',
icon: 'overview'
},
{
value: 'g-pipeline',
label: 'Pipeline',
type: 'group',
children: [
{
value: 'listings',
label: 'Listings',
icon: 'building'
},
{
value: 'clients',
label: 'Clients',
icon: 'users'
},
{
value: 'appointments',
label: 'Appointments',
icon: 'calendar'
}
]
},
{
value: 'g-reports',
label: 'Reports',
type: 'group',
children: [
{
value: 'revenue',
label: 'Revenue',
icon: 'wallet'
},
{
value: 'deals',
label: 'Deals',
icon: 'briefcase',
children: [
{
value: 'deals-open',
label: 'Open'
},
{
value: 'deals-won',
label: 'Won'
},
{
value: 'deals-lost',
label: 'Lost'
}
]
},
{
value: 'performance',
label: 'Performance',
icon: 'trending'
}
]
},
{
value: 'g-workspace',
label: 'Workspace',
type: 'group',
children: [
{
value: 'agents',
label: 'Agents',
icon: 'bot'
},
{
value: 'api-keys',
label: 'API Keys',
icon: 'key'
},
{
value: 'members',
label: 'Members',
icon: 'team'
},
{
value: 'billing',
label: 'Billing',
icon: 'billing'
}
]
},
{
value: 'g-settings',
label: 'Settings',
type: 'group',
children: [
{
value: 'preferences',
label: 'Preferences',
icon: 'settings'
},
{
value: 'labels',
label: 'Labels',
icon: 'tag'
}
]
}
]
const nav = ref('overview')
const open = [
'g-pipeline',
'g-reports',
'g-workspace',
'g-settings',
'deals'
]
const page = 'display:flex;min-height:100vh;background:var(--v-color-bg);color:var(--v-color-text);font-family:var(--v-font-family-sans);'
</script>
<template>
<div :style="page"><aside class="sp-side" aria-label="Workspace navigation"><VSidebar v-model:active-item="nav" class="sp-side__nav" :items="items" :expanded-sections="open" :show-search="false" :show-footer="false" :show-brand="false" aria-label="Workspace" /></aside></div>
</template>Montagem · Seletor de workspace (header)
Seletor de escopo/workspace do Sales Overview. O VSidebar não traz seletor: ele entra no slot #header (substitui a marca). O botão sp-switcher é o gatilho de um VDropdownMenu; ao trocar workspace, recarregue os items do menu.
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar, VDropdownMenu, VIcon } from 'vueui-nova-kit'
const items = []
const workspace = ref('sparkpixel')
const workspaces = [
{
value: 'sparkpixel',
label: 'sparkpixel.studio',
selected: true
},
{
value: 'acme',
label: 'acme.ai'
},
{
value: 'new',
label: 'Create workspace',
icon: 'plus',
divider: true
}
]
const chevronsUpDownIcon = {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M7 9L12 4L17 9M7 15L12 20L17 15\'/>'
}
const page = 'display:flex;min-height:100vh;background:var(--v-color-bg);color:var(--v-color-text);font-family:var(--v-font-family-sans);'
</script>
<template>
<div :style="page"><aside class="sp-side" style="height:auto" aria-label="Workspace navigation"><VSidebar class="sp-side__nav" :items="items" :show-search="false" :show-footer="false" aria-label="Workspace"><template #header>
<VDropdownMenu v-model:value="workspace" :items="workspaces" menu-align="start" aria-label="Switch workspace">
<template #trigger="{ attrs, bindRef }">
<button v-bind="attrs" :ref="bindRef" type="button" class="sp-switcher" aria-haspopup="menu">
<span class="sp-switcher__mark" aria-hidden="true">s</span>
<span class="sp-switcher__name">{{ workspaces.find((w) => w.value === workspace)?.label }}</span>
<VIcon :icon="chevronsUpDownIcon" size="sm" />
</button>
</template>
</VDropdownMenu></template></VSidebar></aside></div>
</template>Montagem · Menu lateral completo
O menu lateral inteiro do Sales Overview: rail de apps (sp-app-rail) + <aside class="sp-side"> com o seletor no #header e o menu com grupos/submenu. Mesmos dados (SalesOverview/data.ts) e mesmo CSS (_shared/sidebarPatterns.scss) do template.
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VSidebar, VDropdownMenu, VIcon } from 'vueui-nova-kit'
const railItems = [
{
value: 'globe',
label: 'Sites',
icon: 'globe'
},
{
value: 'chart',
label: 'Analytics',
icon: 'chart'
},
{
value: 'chat',
label: 'Conversations',
icon: 'chat'
},
{
value: 'file',
label: 'Documents',
icon: 'file'
},
{
value: 'nodes',
label: 'Automations',
icon: 'workflow'
},
{
value: 'settings',
label: 'Settings',
icon: 'settings'
}
]
const navItems = [
{
value: 'overview',
label: 'Overview',
icon: 'overview'
},
{
value: 'g-pipeline',
label: 'Pipeline',
type: 'group',
children: [
{
value: 'listings',
label: 'Listings',
icon: 'building'
},
{
value: 'clients',
label: 'Clients',
icon: 'users'
},
{
value: 'appointments',
label: 'Appointments',
icon: 'calendar'
}
]
},
{
value: 'g-reports',
label: 'Reports',
type: 'group',
children: [
{
value: 'revenue',
label: 'Revenue',
icon: 'wallet'
},
{
value: 'deals',
label: 'Deals',
icon: 'briefcase',
children: [
{
value: 'deals-open',
label: 'Open'
},
{
value: 'deals-won',
label: 'Won'
},
{
value: 'deals-lost',
label: 'Lost'
}
]
},
{
value: 'performance',
label: 'Performance',
icon: 'trending'
}
]
},
{
value: 'g-workspace',
label: 'Workspace',
type: 'group',
children: [
{
value: 'agents',
label: 'Agents',
icon: 'bot'
},
{
value: 'api-keys',
label: 'API Keys',
icon: 'key'
},
{
value: 'members',
label: 'Members',
icon: 'team'
},
{
value: 'billing',
label: 'Billing',
icon: 'billing'
}
]
},
{
value: 'g-settings',
label: 'Settings',
type: 'group',
children: [
{
value: 'preferences',
label: 'Preferences',
icon: 'settings'
},
{
value: 'labels',
label: 'Labels',
icon: 'tag'
}
]
}
]
const open = [
'g-pipeline',
'g-reports',
'g-workspace',
'g-settings',
'deals'
]
const rail = ref('chart')
const nav = ref('overview')
const workspace = ref('sparkpixel')
const workspaces = [
{
value: 'sparkpixel',
label: 'sparkpixel.studio',
selected: true
},
{
value: 'acme',
label: 'acme.ai'
},
{
value: 'new',
label: 'Create workspace',
icon: 'plus',
divider: true
}
]
const chevronsUpDownIcon = {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M7 9L12 4L17 9M7 15L12 20L17 15\'/>'
}
const page = 'display:flex;min-height:100vh;background:var(--v-color-bg);color:var(--v-color-text);font-family:var(--v-font-family-sans);'
</script>
<template>
<div :style="page">
<VSidebar v-model:active-item="rail" class="sp-app-rail" variant="icons" :items="railItems" :show-search="false" :show-footer="false" :show-brand="false" :show-collapse-toggle="false" aria-label="Apps" />
<aside class="sp-side" aria-label="Workspace navigation">
<VSidebar v-model:active-item="nav" class="sp-side__nav" :items="navItems" :expanded-sections="open" :show-search="false" :show-footer="false" aria-label="Workspace"><template #header>
<VDropdownMenu v-model:value="workspace" :items="workspaces" menu-align="start" aria-label="Switch workspace">
<template #trigger="{ attrs, bindRef }">
<button v-bind="attrs" :ref="bindRef" type="button" class="sp-switcher" aria-haspopup="menu">
<span class="sp-switcher__mark" aria-hidden="true">s</span>
<span class="sp-switcher__name">{{ workspaces.find((w) => w.value === workspace)?.label }}</span>
<VIcon :icon="chevronsUpDownIcon" size="sm" />
</button>
</template>
</VDropdownMenu></template></VSidebar>
</aside>
<main style="flex:1"></main>
</div>
</template>Acessibilidade
- ARIA compliant (
aria-expanded,aria-current). - Navegação por teclado (Tab, Enter, Arrow keys).
- Foco visível; screen-reader friendly; labels e estrutura claros.
- "Works in both single and multiple mode" (expansão simples ou múltipla de seções).
Estados
Default · Hover · Focus-visible · Active · Expanded section · Collapsed rail · Disabled
Motion
| Trigger | Property | Duration | Easing |
|---|---|---|---|
| Collapse/expand | width, padding | 200ms | ease-out |
| Item hover | background | 100ms | standard |
| Chevron rotate | transform | 200ms | ease-out |
| Submenu / group open | grid-template-rows, opacity | 200ms | ease-out |
Respeitar prefers-reduced-motion.
Ícones por nome (icon: 'pie-chart' | 'sliders' | 'receipt' | 'chart-line' | 'dollar-sign' | 'help-circle' | 'log-out' | 'sun' | 'moon' …) são resolvidos via registry Keyline.
Todas as transições respeitam prefers-reduced-motion e os tokens --v-duration-*.
Props
| Prop | Tipo | Default | Descrição |
|---|---|---|---|
collapsed | boolean | — | Controls collapsed (icon-only rail) state. `v-model:collapsed` (primary) — `modelValue` accepted as alias. |
modelValue | boolean | — | — |
items | VSidebarItem[] | — | — |
activeItem | string | — | — |
expandedSections | string[] | — | — |
accordion | boolean | true | Opening an expandable item closes its open siblings. Default `true`. |
accordionGroups | boolean | false | Also apply accordion behaviour between sibling groups. Default `false`. |
filterOnSearch | boolean | true | Filter items by label while typing in the search field. Default `true`. |
brandName | string | "VueUI Nova" | — |
brandIcon | string | — | — |
searchPlaceholder | string | "Search…" | — |
showSearch | boolean | true | — |
searchShortcut | string | "⌘K" | — |
userName | string | "Alex Chen" | — |
userEmail | string | "alex@nova.dev" | — |
userAvatar | string | "AC" | — |
heading | string | "" | Title that stays visible in the floating chip and in the open sidebar. |
position | string | "" | Where the user is. Stays visible when the floating sidebar is closed or open. |
locked | boolean | false | Pins the sidebar open. The floating chip cannot collapse it. |
size | VSidebarSize | "md" | — |
width | string | number | — | Panel width. Number = px, string = any CSS length. Sets `--v-sidebar-width` on the root. |
groupChevron | 'start' | 'end' | "end" | Where the chevron of a collapsible group sits. Default `'end'`. |
groupChevronOpen | 'up' | 'down' | "down" | Direction of the chevron of an open collapsible group. `'down'` (default) rotates -90deg when closed; `'up'` shows "v" closed and "^" open. |
chevron | 'rotate' | 'updown' | "rotate" | Chevron of expandable items. `'rotate'` (default) is ">" rotating 90deg; `'updown'` is "v" closed and "^" open. |
groupDividers | boolean | false | Hairline above every group except the first. Default `false`. |
variant | VSidebarVariant | "default" | `card` is a soft menu. `workspace` raises the active item. `icons` is the small icon islands. `floating` is the compact card that opens downward. |
showBrand | boolean | true | — |
showFooter | boolean | true | — |
showCollapseToggle | boolean | true | Shows the collapse/expand toggle (icons rail, collapsed rail, inline). Default `true`. |
disabled | boolean | false | — |
ariaLabel | string | — | — |
Events
| Evento | Payload | Descrição |
|---|---|---|
@update:collapsed | value: boolean | — |
@update:modelValue | value: boolean | — |
@update:locked | value: boolean | — |
@update:activeItem | value: string | — |
@update:expandedSections | value: string[] | — |
@select | value: string | — |
@section-toggle | value: string, expanded: boolean | — |
@search | query: string | — |
Slots
| Slot | Props do slot |
|---|---|
#header | collapsedtoggle |
#before-nav | — |
#after-nav | — |
#footer | collapsed |
Fonte: src/components/navigation/VSidebar/VSidebar.vue · tipos: src/components/navigation/VSidebar/VSidebar.types.ts