Superfícies
VPanel
O `VPanel` é um contentor flexível para agrupar conteúdo relacionado — informação, ações e media — em secções claras e autocontidas. Cabeçalho do poster: **"Panel — A flexible container for grouped content"**. Promessa do hero: *"Panel provides a flexible content container for related information, actions, and media.
<script setup lang="ts">
import { VPanel } 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 VPanel.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. Props: title="Panel Title", description="Brief description of the pa…".
Ver código
<script setup lang="ts">
import { VPanel } from 'vueui-nova-kit'
const args = {
size: 'md',
variant: 'default',
title: 'Panel Title',
description: 'Brief description of the panel.'
}
</script>
<template>
<VPanel v-bind="args"><p>Panel content goes here.</p></VPanel>
</template>Bordered
Variação Bordered. Props: variant="bordered", title="Panel Title", description="Subtle border for separatio…".
Ver código
<script setup lang="ts">
import { VPanel } from 'vueui-nova-kit'
const args = {
size: 'md',
variant: 'bordered',
title: 'Panel Title',
description: 'Subtle border for separation.'
}
</script>
<template>
<VPanel v-bind="args"><p>Content.</p></VPanel>
</template>Elevated
Variação Elevated. Props: variant="elevated", title="Panel Title", description="Raised surface with shadow.".
Ver código
<script setup lang="ts">
import { VPanel } from 'vueui-nova-kit'
const args = {
size: 'md',
variant: 'elevated',
title: 'Panel Title',
description: 'Raised surface with shadow.'
}
</script>
<template>
<VPanel v-bind="args"><p>Content.</p></VPanel>
</template>Filled
Variação Preenchido. Props: variant="filled", title="Panel Title", description="Subtle background tint.".
Ver código
<script setup lang="ts">
import { VPanel } from 'vueui-nova-kit'
const args = {
size: 'md',
variant: 'filled',
title: 'Panel Title',
description: 'Subtle background tint.'
}
</script>
<template>
<VPanel v-bind="args"><p>Content.</p></VPanel>
</template>Sizes
Variação Tamanhos.
Ver código
<script setup lang="ts">
import { VPanel } from 'vueui-nova-kit'
</script>
<template>
<div style="display:flex;gap:16px;align-items:flex-start">
<VPanel size="sm" title="Small"><p>Compact content.</p></VPanel>
<VPanel size="md" title="Medium"><p>Everyday use.</p></VPanel>
<VPanel size="lg" title="Large"><p>Content-heavy sections.</p></VPanel>
</div>
</template>With Actions
Variação Com ações. Props: title="Project Overview", description="Key information about your …". Slots usados: #actions, #footer.
Ver código
<script setup lang="ts">
import { VPanel, VButton } from 'vueui-nova-kit'
const args = {
size: 'md',
variant: 'default',
title: 'Project Overview',
description: 'Key information about your project.'
}
</script>
<template>
<VPanel v-bind="args">
<template #actions><VButton variant="ghost" size="sm" aria-label="Mais ações">•••</VButton></template>
<p>Panel content goes here.</p>
<template #footer><VButton variant="secondary">Cancel</VButton><VButton variant="primary">Save changes</VButton></template>
</VPanel>
</template>Interactive
Variação Interativo. Props: interactive=true, title="Focusable panel".
Ver código
<script setup lang="ts">
import { VPanel } from 'vueui-nova-kit'
</script>
<template>
<VPanel v-model="value" interactive title="Focusable panel" />
</template>Heading Level3
Variação Heading Level3. Props: headingLevel="3", title="Painel com h3", description="Use headingLevel para man…".
Ver código
<script setup lang="ts">
import { VPanel } from 'vueui-nova-kit'
</script>
<template>
<VPanel
v-model="value"
title="Painel com h3"
description="Use `headingLevel` para manter a hierarquia de títulos da página." />
</template>Controlled Open
Visibilidade controlada com v-model:open.
Ver código
<script setup lang="ts">
import { ref } from 'vue'
import { VPanel, VButton } from 'vueui-nova-kit'
const args = {
size: 'md',
variant: 'default'
}
const open = ref(true)
</script>
<template>
<div style="display:grid;gap:12px"><VPanel v-bind="args" v-model:open="open" title="Painel controlado">Conteúdo</VPanel><VButton variant="outline" @click="open = !open">Alternar (open = {{ open }})</VButton></div>
</template>Acessibilidade
Semântica nativa primeiro, foco visível, labels acessíveis e teclado conforme o padrão WAI-ARIA correspondente.
Estados
Default · Hover · Focus-visible · Pressed/Active quando aplicável · Disabled · Loading quando aplicável.
Motion
| Trigger | Property | Duration | Easing |
|---|---|---|---|
| Hover | background/transform | 100ms | standard |
| Focus | outline/box-shadow | 100ms | standard |
| Enter/Exit | opacity/transform | 160ms | standard |
Respeitar prefers-reduced-motion.
Todas as transições respeitam prefers-reduced-motion e os tokens --v-duration-*.
Props
| Prop | Tipo | Default | Descrição |
|---|---|---|---|
title | string | — | — |
description | string | — | — |
icon | string | — | — |
headingLevel | VPanelHeadingLevel | "3" | — |
size | VPanelSize | "md" | — |
variant | VPanelVariant | "default" | — |
open | boolean | undefined | Controls visibility. `v-model:open` (primary) — `modelValue` accepted as alias. |
modelValue | boolean | undefined | — |
interactive | boolean | false | When true the panel becomes keyboard-focusable (tabindex 0). |
ariaLabel | string | — | — |
Events
| Evento | Payload | Descrição |
|---|---|---|
@update:open | value: boolean | — |
@update:modelValue | value: boolean | — |
@click | event: MouseEvent | KeyboardEvent | — |
Slots
| Slot | Props do slot |
|---|---|
#icon | — |
#title | — |
#description | — |
#header | — |
#actions | — |
#default | — |
#footer | — |
Fonte: src/components/containment/VPanel/VPanel.vue · tipos: src/components/containment/VPanel/VPanel.types.ts