Superfícies

VPanel

Componentev-model9 exemplos10 propsA2UI · Panel

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.

Importação
<script setup lang="ts">
import { VPanel } from 'vueui-nova-kit'
</script>

Uso

Exemplo
<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
vue
<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
vue
<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
vue
<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
vue
<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
vue
<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
vue
<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
vue
<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
vue
<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
vue
<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

TriggerPropertyDurationEasing
Hoverbackground/transform100msstandard
Focusoutline/box-shadow100msstandard
Enter/Exitopacity/transform160msstandard

Respeitar prefers-reduced-motion.

Todas as transições respeitam prefers-reduced-motion e os tokens --v-duration-*.

Props

PropTipoDefaultDescrição
titlestring——
descriptionstring——
iconstring——
headingLevelVPanelHeadingLevel"3"—
sizeVPanelSize"md"—
variantVPanelVariant"default"—
openbooleanundefinedControls visibility. `v-model:open` (primary) — `modelValue` accepted as alias.
modelValuebooleanundefined—
interactivebooleanfalseWhen true the panel becomes keyboard-focusable (tabindex 0).
ariaLabelstring——

Events

EventoPayloadDescrição
@update:openvalue: boolean—
@update:modelValuevalue: boolean—
@clickevent: MouseEvent | KeyboardEvent—

Slots

SlotProps do slot
#icon—
#title—
#description—
#header—
#actions—
#default—
#footer—

Fonte: src/components/containment/VPanel/VPanel.vue · tipos: src/components/containment/VPanel/VPanel.types.ts